Getting Alerts with Context out of Log Server

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
dh0125e
Posts: 40
Joined: Tue Aug 04, 2020 9:30 am

Getting Alerts with Context out of Log Server

Post by dh0125e »

I'm trying to get logs with context that are more then just "X iterations were found". From the previous question I posted only email supports the macro for the actual logs.

So now I'm looking into what external API query options I have ...

Can I execute a saved query via the REST API? I found how to execute a custom on demand query however I don't want to have to manage the queries in an external system.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Getting Alerts with Context out of Log Server

Post by gsmith »

Hi

It sounds like it is possible, but not simple. Search for the saved query and
within the response will be searchSourceJSON. It is a JSON encoded object from which
you can use the index and query to then query Elasticsearch directly.

I have not tried this so I do not know how much, if any, massaging of the returnede data is
required to create a query on-the-fly.

Thanks
Locked