Regex to filter out last column of a log

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Regex to filter out last column of a log

Post by scottwilkerson »

You would need to create a grok filter in the configuration as described in this document
https://assets.nagios.com/downloads/nag ... ilters.pdf

Then, when logs come in it will break the logs that match the filter into different fields instead of them all being in the message field
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tvoll
Posts: 39
Joined: Fri Aug 16, 2019 9:06 am

Re: Regex to filter out last column of a log

Post by tvoll »

I tried that before and it still isn't working.
Look at the example I pasted in my prior post.
What did I do wrong?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Regex to filter out last column of a log

Post by scottwilkerson »

tvoll wrote:I tried that before and it still isn't working.
Look at the example I pasted in my prior post.
What did I do wrong?
Sorry I didn't see your example, it would need to be something like this

Code: Select all

if [host] == '0.0.0.0' {
    grok {
        match => [ 'message', '%{SYSLOG5424PRI}%{SYSLOGBASE} %{WORD} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT:IOUTIL}' ]
        overwrite => [ 'message' ]
    }
}
changing 0.0.0.0 to the host sending these messages
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tvoll
Posts: 39
Joined: Fri Aug 16, 2019 9:06 am

Re: Regex to filter out last column of a log

Post by tvoll »

scottwilkerson wrote:
tvoll wrote:I tried that before and it still isn't working.
Look at the example I pasted in my prior post.
What did I do wrong?
Sorry I didn't see your example, it would need to be something like this

Code: Select all

if [host] == '0.0.0.0' {
    grok {
        match => [ 'message', '%{SYSLOG5424PRI}%{SYSLOGBASE} %{WORD} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT} %{BASE16FLOAT:IOUTIL}' ]
        overwrite => [ 'message' ]
    }
}
changing 0.0.0.0 to the host sending these messages
I applied it, and it is still not working. It adds the IOUTIL Field, but when I filter by it, it shows that nothing has that result, and so it stays empty. Looking at individual results, the tag field has the entry "_grokparsefailure".
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Regex to filter out last column of a log

Post by scottwilkerson »

Actually, I think this line should be removed

Code: Select all

overwrite => [ 'message' ]
We may need to see actual examples of these, if you still cannot get this to work, please open a ticket here and reference this thread
https://support.nagios.com/tickets/
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tvoll
Posts: 39
Joined: Fri Aug 16, 2019 9:06 am

Re: Regex to filter out last column of a log

Post by tvoll »

scottwilkerson wrote:Actually, I think this line should be removed

Code: Select all

overwrite => [ 'message' ]
We may need to see actual examples of these, if you still cannot get this to work, please open a ticket here and reference this thread
https://support.nagios.com/tickets/
Still no go.
Sent in a ticket on the matter.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Regex to filter out last column of a log

Post by cdienger »

Ticket received. We will close this thread and work through the ticket.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked