Sponsored Content
Top Forums Shell Programming and Scripting How to grep logs for errors and receive specific additional lines? Post 302857153 by Don Cragun on Wednesday 25th of September 2013 01:37:44 PM
Old 09-25-2013
Quote:
Originally Posted by nbsparks
I have run into a new issue. There are occasionally "[WARNING]" messages that I care about as much as "[SEVERE]" messages. Thus, I would like to be able to trigger on more than just "SEVERE". How do I trigger on more than just that?

I'm thinking of triggering on these so far:

  • SEVERE
  • java.lang.ClassCastException (or possibly just "java.lang.Class*" as there should never be any of that in a happy log file)
  • generated an exception
Of course, if I start to overlap with "SEVERE" then I may just have to use other triggers instead. Not sure.

Thanks in advance for any help you can provide.
The changes you are suggesting require a completely different aproach than the script I provided before uses.

It really isn't fair to those of us who want to help you to say that you're thinking about a list of triggers. Let us know when you've thought about it enough to give us solid requirements.

The issues that were raised when you started this thread seem to have been resolved. When you can show us representative input data, corresponding desired output, and a complete set of requirements for this new problem, please start a new thread to discuss it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

retrieving specific lines from a file - can I use grep ?

Hi there, if i had a file that looked like this my_server1 red green blue yellow blue my_server2 blue blue yellow green blue my_server3 yellow (9 Replies)
Discussion started by: hcclnoodles
9 Replies

2. Shell Programming and Scripting

Grep for lines in web logs

I want to find the unique url in a apache logs which got 404 error . I can do something like "cat apache.log|grep 404|awk '{print $2,$3}'|grep 404 this will give me say /foo.html 404 /foo.html 404 /foo.html 404 /bar.html 404 /cat.html 404 However my output should only find... (3 Replies)
Discussion started by: gubbu
3 Replies

3. UNIX Desktop Questions & Answers

grep lines with two specific characters somewhere in the line

I'm having trouble with extracting certain lines from a file based on whether they have all the required fields. Original file: snt:594:Sam N This bpt:2342:Bob P That lr:123 wrp:23:Whoever Person cor:794 Desired output: snt:594:Sam N This bpt:2342:Bob P That wrp:23:Whoever Person ... (3 Replies)
Discussion started by: Chthonic
3 Replies

4. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

5. Shell Programming and Scripting

Problems to print specific lines with awk and grep...HELP!

Hi all I have data like this: model: 1, misfit value: 0.74987 1 1.182 1.735 2.056 1.867 2 0.503 1.843 2.018 1.888 3 2.706 2.952 2.979 1.882 4 8.015 3.414 3.675 1.874 ... (1 Reply)
Discussion started by: fedora2011
1 Replies

6. Shell Programming and Scripting

using awk to get specific section of lines in logs

i have a log file that has the date and time that looks like this: Wed Jun 28 15:46:21 2012 test failed tailed passed passed not error panic what we want to focus on is the first 5 columns because they contain the date and time. the date and time can be anywhere on the line. in this... (6 Replies)
Discussion started by: SkySmart
6 Replies

7. Shell Programming and Scripting

grep the output between specific lines

Symmetrix ID : 00000001234 Host Name : myown Identifiers Found : 5000000000000000 5000000000000001 Device Cap(MB) Attr Dir:P ------ ------- ---- ---- 1234 25886 (M) 8D:1, 9D:1 0123 25886 (M) 8D:1, 9D:1 1345 25886 (M) ... (5 Replies)
Discussion started by: maddy.san
5 Replies

8. Shell Programming and Scripting

Script to grep logs for Errors

Hi Guys, I want to write a script which can grep the logs (server.log) from a file for Error String and output to a other file. Problems: How to know about the errors only between the current restart and not in previous as server.log has earlier restarts also? thanks for the help! Much... (5 Replies)
Discussion started by: ankur328
5 Replies

9. UNIX for Dummies Questions & Answers

Grep specific lines

Hello I have a file with nearly 90000 lines in x,y,z format but have some lines that I do not need to show. Is there anyway to delete those 3 lines after every 288 lines. Eg I keep the first 288 lines delete (289, 290 291); keep the next 288 lines after those and so on... Thanks (6 Replies)
Discussion started by: Madiouma Ndiaye
6 Replies

10. Shell Programming and Scripting

Grep content between specific lines

cat file1 *FileHeader* Partition 0 Total Data Bytes 1416 Avg Bytes/Record 1416 Others 1 PRDX22.AUDIT_DATA_INFO Partition 4 Total Data Bytes 4615 Avg... (8 Replies)
Discussion started by: Veera_V
8 Replies
deb-triggers(5)                                                     dpkg suite                                                     deb-triggers(5)

NAME
deb-triggers - package triggers SYNOPSIS
triggers DESCRIPTION
A package declares its relationship to some trigger(s) by including a triggers file in its control archive (i.e. DEBIAN/triggers during package creation). This file contains directives, one per line. Leading and trailing whitespace and everything after the first # on any line will be trimmed, and empty lines will be ignored. The trigger control directives currently supported are: interest trigger-name interest-await trigger-name interest-noawait trigger-name Specifies that the package is interested in the named trigger. All triggers in which a package is interested must be listed using this directive in the triggers control file. The "noawait" variant does not put the triggering packages in triggers-awaited state. This should be used when the functionality provided by the trigger is not crucial. activate trigger-name activate-await trigger-name activate-noawait trigger-name Arranges that changes to this package's state will activate the specified trigger. The trigger will be activated at the start of the following operations: unpack, configure, remove (including for the benefit of a conflicting package), purge and deconfigure. The "noawait" variant does not put the triggering packages in triggers-awaited state. This should be used when the functionality provided by the trigger is not crucial. If this package disappears during the unpacking of another package the trigger will be activated when the disappearance is noted towards the end of the unpack. Trigger processing, and transition from triggers-awaited to installed, does not cause activations. In the case of unpack, triggers mentioned in both the old and new versions of the package will be activated. Unknown directives are an error which will prevent installation of the package. The "-noawait" variants should always be favored when possible since triggering packages are not put in triggers-awaited state and can thus be immediately configured without requiring the processing of the trigger. If the triggering packages are dependencies of other upgraded packages, it will avoid an early trigger processing run and make it possible to run the trigger only once as one of the last steps of the upgrade. The "-noawait" variants are supported since dpkg 1.16.1, and will lead to errors if used with an older dpkg. The "-await" alias variants are supported since dpkg 1.17.21, and will lead to errors if used with an older dpkg. SEE ALSO
dpkg-trigger(1), dpkg(1), /usr/share/doc/dpkg-dev/triggers.txt.gz. 1.19.0.5 2018-04-16 deb-triggers(5)
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy