Nagios Filter and and Query syntax

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
SteveO86
Posts: 6
Joined: Thu Jan 26, 2017 9:26 am

Nagios Filter and and Query syntax

Post by SteveO86 »

Where can I find out about syntax for writing the queries. (screenshot attached)

I know I can click through and add filters that way but it would definitely be quicker to type.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Filter and and Query syntax

Post by rkennedy »

The same properties apply when writing them out, as they do when it comes to clicking and selecting with the magnifying glass.

We have two general informational points here that might help -
https://assets.nagios.com/downloads/nag ... Server.pdf
https://www.youtube.com/watch?v=vvhChfb5ruQ


What exactly are you looking to do?
Former Nagios Employee
SteveO86
Posts: 6
Joined: Thu Jan 26, 2017 9:26 am

Re: Nagios Filter and and Query syntax

Post by SteveO86 »

Thanks for the quick reply!

I am looking to build custom dashboards for different views. Similar to the following:

1. Dashboard that only display logs from 'edge firewalls'
2. Dashboard that only display logs from 'internal firewalls'

And then within each dashboard have different colored coded events for denied events vs allowed events and others

I was thinking each dashboard would have a filter based on multiple host IPs and use queries to color code the different events and I was just curious on Syntax.

EDIT: actually appears I can just used 'or' and 'and' statements example in the query string
host 10.10.10.1 or host 10.10.10.2 or host 10.10.10.3
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Filter and and Query syntax

Post by mcapra »

There's two simple ways of looking at queries: Either you're using filters, or you're using Lucene. You can also use both at the same time. Stuff like this:

Code: Select all

host 10.10.10.1 or host 10.10.10.2 or host 10.10.10.3
Is Lucene. More info on Lucene syntax:
https://lucene.apache.org/core/2_9_4/qu ... yntax.html

A more appropriate formatting if your previously mentioned query might look like this:

Code: Select all

host:"10.10.10.1" OR host:"10.10.10.2" OR host:"10.10.10.3"
Former Nagios employee
https://www.mcapra.com/
Locked