Nagios Log Server 2.0.2 - Exporting to CSV

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
CameronWP
Posts: 134
Joined: Fri Apr 17, 2015 2:17 pm

Nagios Log Server 2.0.2 - Exporting to CSV

Post by CameronWP »

Hello:

I really like the new log server version but have found something strange. It seems that the exports I do don't match what is reported as available to export. For example, one query had 178 hits. I configured the pagination to show me all of the items on one screen and then exported to CSV. The resulting CSV only has 67 lines. So it appears that 111 items were not exported. Is there something I am missing?

Thanks!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by npolovenko »

Hello, @CameronWP. Can you try exporting some other queries to CVS, would there also be some missing entries? Can you show us the query? Also, did it say "178 available for paging"?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
CameronWP
Posts: 134
Joined: Fri Apr 17, 2015 2:17 pm

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by CameronWP »

Hi:

Page.JPG
Page2.JPG
My query is simply looking for event id 4624 for a particular user over a particular time frame. I have attempted the export for different time frames and have the same issue each time.

Thanks!
You do not have the required permissions to view the files attached to this post.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by tacolover101 »

i don't have an NLS instance online so i won't be much help, but... what is the query you're running specifically? it may help to reproduce this issue.
CameronWP
Posts: 134
Joined: Fri Apr 17, 2015 2:17 pm

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by CameronWP »

Thanks for the reply. Here is the query:

"name": "Dickey",
"raw": "{\"query\":{\"filtered\":{\"query\":{\"bool\":{\"should\":[{\"query_string\":{\"query\":\"*dickey*\"}}]}},\"filter\":{\"bool\":{\"must\":[{\"range\":{\"@timestamp\":{\"from\":1491069131192,\"to\":1506793931192}}},{\"fquery\":{\"query\":{\"query_string\":{\"query\":\"EventID:(4624)\"}},\"_cache\":true}}]}}}}}",
"services": "{\"query\":{\"list\":{\"0\":{\"query\":\"*dickey*\",\"alias\":\"\",\"color\":\"#4D89F9\",\"id\":0,\"pin\":false,\"type\":\"lucene\",\"enable\":true}},\"ids\":[0]},\"filter\":{\"list\":{\"0\":{\"from\":\"2017-04-01T17:52:11.192Z\",\"to\":\"2017-09-30T17:52:11.192Z\",\"type\":\"time\",\"field\":\"@timestamp\",\"mandate\":\"must\",\"active\":true,\"alias\":\"\",\"id\":0},\"1\":{\"type\":\"field\",\"field\":\"EventID\",\"query\":\"4624\",\"mandate\":\"must\",\"active\":true,\"alias\":\"\",\"id\":1}},\"ids\":[0,1]}}",
"created_by": "naguser",
"created_id": "1",
"show_everyone": 0,
"imported": 0
}
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by cdienger »

What is the memory limit set to in /etc/php.ini?

The default is only 128 and this can cause issues with not getting full reports or exports. Find the line and change it to:

memory_limit = 1028M

and restart the httpd service:

service httpd restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
CameronWP
Posts: 134
Joined: Fri Apr 17, 2015 2:17 pm

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by CameronWP »

I was running at 512m and upgraded it to 1024m. I tried the export again and get 2015 records.

I checked the logs and found:

rejected execution (queue capacity 1000) on org.elasticsearch.search.action.SearchServiceTransportAction$23@2f1d7b5e

I am wondering if that is part of the issue?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by npolovenko »

@CameronWP, Please open the elasticsearch.yml file:

Code: Select all

nano /usr/local/nagioslogserver/elasticsearch/config/elasticsearch.yml
And add this line to the end of the file:

Code: Select all

threadpool.search.queue_size: -1
And after that please restart the elasticsearch with:

Code: Select all

service elasticsearch restart
I also recommend increasing the ram and the CPU for this VM. Seems like a lot of these problems are the result of resource insufficiency, or the query is too long.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by mcapra »

Alternatively, nlsexport handles large/complex queries a bit more gracefully without fiddling with ElasticSearch internals.

Just my opinion: Having taken a peek at the code behind the native CSV export functionality, I'd say this should be a bug report. A vanilla _search request is not a very safe way to handle queries of arbitrary size and complexity.

There's a very good reason the ElasticSearch search queue size is capped: It leaves room for write operations. Exhausting your thread pool with a large search seems like it could potentially introduce write failures.
Former Nagios employee
https://www.mcapra.com/
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios Log Server 2.0.2 - Exporting to CSV

Post by dwhitfield »

npolovenko wrote: I also recommend increasing the ram and the CPU for this VM. Seems like a lot of these problems are the result of resource insufficiency, or the query is too long.
While @mcapra is correct, I want to emphasize the above as well.
Locked