Add new patterns

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Add new patterns

Post by vmesquita »

Hi!

I am trying to add some patterns to match /var/log/maillog fields, following the ideas in the logstash Book (https://logstashbook.com/)

So the author suggest to add the following code to te file /etc/logstash/patterns:

Code: Select all

COMP ([\w._\/%-]+)
COMPPID postfix\/%{COMP:component}(?:\[%{POSINT:pid}\])?
QUEUEID ([A-F0-9]{5,15}{1})
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
POSTFIX %{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{COMPPID}: %{QUEUEID:queueid}
POSTFIXQMGR %{POSTFIX}: (?:removed|from=<(?:%{EMAILADDRESS:from})?>(?:, size=%{POSINT:size}, nrcpt=%{POSINT:nrcpt} \(%{GREEDYDATA:queuestatus}\))?)
However the file doesn't exist, not even the folder /etc/logstash. So in Nagios Log Server install, where should I put this file, or how can I add new patterns?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Add new patterns

Post by hsmith »

Check /usr/local/nagioslogserver/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-0.1.10/patterns/grok-patterns out.
Former Nagios Employee.
me.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Add new patterns

Post by vmesquita »

That's exactly what I needed. Thanks.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Add new patterns

Post by mcapra »

Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Add new patterns

Post by eloyd »

FYI - we got tired of remembering that, and just make a link: /usr/local/patterns -> /usr/local/nagioslogserver/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-0.1.10/patterns/grok-patterns
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Add new patterns

Post by rkennedy »

That works too :-)

@vmesquita - let us know if you have any further questions.
Former Nagios Employee
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Add new patterns

Post by vmesquita »

Thanks! It's all working, you can close the thread.
Locked