Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question about seperating messages using metalog and regex
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
CptanPanic
n00b
n00b


Joined: 17 Jan 2003
Posts: 48

PostPosted: Tue Jan 21, 2003 5:57 pm    Post subject: Question about seperating messages using metalog and regex Reply with quote

Hello,
I would like to seperate all my firewall kernel messages from my kernel log into its own diretory. I have tried just adding the regex for the items and it does put them into their own directory but they still show up in the original kernel logs. I guess I need to do an opposite regex for the kernel log config, but I don't know how to do a negative regexp with metalog. Does anyone know?
Thanks,

Brian
Back to top
View user's profile Send private message
Jyrinx
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2002
Posts: 92
Location: Carleton College - Northfield, MN

PostPosted: Thu Jan 23, 2003 5:53 am    Post subject: Reply with quote

Oddly enough, it does appear that there is no way to do this with Metalog. (See this thread on the message board. I searched because I need the answer too ...) Pain in the ass. Metalog may be cool, but it's painfully obviously quite immature and slowly developing - version 0.7 beta (with negative regexes, I think) has been out since April with no release since. (This can't be that hard to implement ...)

I'm hereby switching to syslog-ng ... Metalog is just too limited. (It's really very stupid that the Gentoo install docs recommend it for those who don't know which to pick. Now everyone's hung up on dumb stuff like negating a filter.)

Jyrinx
jyrinx_list@mindspring.com[/url]
Back to top
View user's profile Send private message
CptanPanic
n00b
n00b


Joined: 17 Jan 2003
Posts: 48

PostPosted: Thu Jan 23, 2003 4:41 pm    Post subject: Reply with quote

I too was wondering why gentoo would pick something with no active development. I will too try syslog-ng, could you let me know how you unistall metalog and install syslog-ng without messing thigs up?
Thanks,
Bri
Back to top
View user's profile Send private message
hhaamu
Apprentice
Apprentice


Joined: 23 Aug 2002
Posts: 253
Location: Finland

PostPosted: Thu Jan 23, 2003 8:27 pm    Post subject: Reply with quote

Try:

Code:

rc-update del metalog
emerge syslog-ng
/etc/init.d/metalog stop
/etc/init.d/syslog-ng start
rc-update add syslog-ng default
emerge -C metalog


(I haven't tried this myself, but it should work)
Back to top
View user's profile Send private message
fifo
Guru
Guru


Joined: 14 Jan 2003
Posts: 437

PostPosted: Mon Feb 24, 2003 4:34 pm    Post subject: Reply with quote

I had this same problem, but it turns out that in fact there is an easy way to filter out iptables messages with metalog. First add a section to /etc/metalog/metalog.conf for logging the firewall messages:
Code:

iptables messages :

  facility = "kern"
  regex    = "^.*IN="
  logdir   = "/var/log/iptables"

Then change the kernel and everything sections to remove those same messages:
Code:

Kernel messages :

  facility = "kern"
  regex    = "^(?!.*IN=)"
  logdir   = "/var/log/kernel"

Everything important :

  facility = "*"
  minimum  = 6
  regex    = "^(?!.*IN=)"
  logdir   = "/var/log/everything"

Now just restart metalog
Code:
# /etc/init.d/metalog restart

and away you go. It will create /var/log/iptables/current when it first want to flush something to the log.

In general, with pcre, you can express the negation of the regexp "^foo" by saying "^(?!foo)".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum