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
Regex to filter out last column of a log
-
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
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?
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
Sorry I didn't see your example, it would need to be something like thistvoll 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?
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' ]
}
}Re: Regex to filter out last column of a log
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 wrote:Sorry I didn't see your example, it would need to be something like thistvoll 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?changing 0.0.0.0 to the host sending these messagesCode: 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' ] } }
-
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
Actually, I think this line should be removed
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/
Code: Select all
overwrite => [ 'message' ]https://support.nagios.com/tickets/
Re: Regex to filter out last column of a log
Still no go.scottwilkerson wrote:Actually, I think this line should be removedWe may need to see actual examples of these, if you still cannot get this to work, please open a ticket here and reference this threadCode: Select all
overwrite => [ 'message' ]
https://support.nagios.com/tickets/
Sent in a ticket on the matter.
Re: Regex to filter out last column of a log
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.