Filtering keywords from syslog.


 
Thread Tools Search this Thread
Operating Systems AIX Filtering keywords from syslog.
# 1  
Old 10-05-2015
Filtering keywords from syslog.

Hi,

My syslog in AIX forwards all user facility to a specific log /logs/user.log

I need to further segregate the user.log to logs specific to various applications and i was wondering if i can make some configuration change to syslog.conf to forward messages based on a certain keyword?

for eg:
Code:
INTBRK                     /logs/INTBRK.log
SOAP                       /logs/WebSvc.log
.Net                         /logs/IIS.log

currently the configuration in syslog.conf is as below:

Code:
user.info    /logs/user.log  rotate size 10m files 10 compress
user.err     /logs/user.log  rotate size 10m files 10 compress
user.error   /logs/user.log  rotate size 10m files 10 compress
user.warn    /logs/user.log  rotate size 10m files 10 compress

Moderator's Comments:
Mod Comment Use code tags, thanks.

Last edited by zaxxon; 10-06-2015 at 05:08 AM.. Reason: code tags
# 2  
Old 10-06-2015
Hi,

first of: you didn't need specify each priority.
Code:
# <priority> is one of (from high to low):
#       emerg/panic,alert,crit,err(or),warn(ing),notice,info,debug
#       (meaning all messages of this priority or higher)

So user.info /logs/user.log rotate size 10m files 10 compress will do the trick.

It is (currently) not possible to use filter words in AIX syslog. You can use either syslog-ng or use the facility labels local0 to local7 - as far it is possible to define the syslog facility in your application.

Regards

Last edited by -=XrAy=-; 10-06-2015 at 08:15 AM..
# 3  
Old 10-06-2015
it can be very tricky to do it with AIX supplied syslogd. I would recommend to keep it simple and to parse the log file.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Split content based on keywords

I need to split the file contents with multiple rows based on patterns Sample: Input: ABC101testXYZ102UKMNO1092testing ABC999testKMNValid Output: ABC101test XYZ102U KMN1092testing ABC999test KMNValid In this ABC , XYZ and KMN are patterns (6 Replies)
Discussion started by: Jairaj
6 Replies

2. Shell Programming and Scripting

How to grep keywords?

I have below text file only with one line: vi test.txt This is the first test from a1.loa1 a1v1, b2.lob2, "c3.loc3" c3b1, loc4 but not from mot3 and second test from a5.loa5 Below should be the output that i want: a1.loa1 b2.lob2 c3.loc3 loc4 a5.loa5 alv1 and c3b1 should be... (3 Replies)
Discussion started by: khchong
3 Replies

3. Shell Programming and Scripting

Grep Keywords one by one

Hi I am trying to determine number of lines having a specific keyword. So for that I am using below query: grep -i 'keyword1' filename|wc -l This give me number of lines. Perfect for me. However now the requirement is I have multiple keywords together... and I have to find number of... (3 Replies)
Discussion started by: dashing201
3 Replies

4. Shell Programming and Scripting

Extract word between two KEYWORDS

Hi I want to extract all the words between two keywords HELLO & BYE. eg: Input 1_HELLO_HOW_ARE_YOU_BYE_TEST 1_HELLO_WHERE_ARE_BYE_TEST 1_HELLO_HOW_BYE_TEST Output Required: HOW_ARE_YOU WHERE_ARE HOW (7 Replies)
Discussion started by: dashing201
7 Replies

5. Shell Programming and Scripting

Parsing with keywords

Hi All, Please help with code for this. I want to parse several huge files and summarize relevant information into columns. The columns of output are title, pagebegin,pageend, author1,author2....,author8, abstract. Column descriptions are as follows. Title Line after single integer value... (3 Replies)
Discussion started by: alpesh
3 Replies

6. Shell Programming and Scripting

searching keywords in file

hey guys, Hey all, I'm doing a project currently and want to index words in a webpage. So there would be a file with webpage content and a file with list of words, I want an output file with true and false that would show which word exists in the webpage. example: Webpage content... (2 Replies)
Discussion started by: Johanni
2 Replies

7. Shell Programming and Scripting

Search a file with keywords

Hi All I have a file of format asdf asf first sec endi asdk rt 123 ferf dfg ijglkp (7 Replies)
Discussion started by: mailabdulbari
7 Replies

8. Shell Programming and Scripting

How to cut id between keywords?

Hi, how to cut id from line ? ....<a class='adata' href='User.php?uid=545554'>.... to 545554 (3 Replies)
Discussion started by: Trump
3 Replies

9. Shell Programming and Scripting

Regarding use and require keywords

Hi, what is the difference between use and require keywords in Perl. What is the significance of these lines (what it mean, what is the use of this) #!/usr/bin/perl -w // In Perl script.... #!/bin/ksh //In shell script..... Thanks Sweta (2 Replies)
Discussion started by: sweta
2 Replies
Login or Register to Ask a Question