Different log storage duration based on type

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
technosol
Posts: 36
Joined: Mon May 07, 2018 11:46 am

Different log storage duration based on type

Post by technosol »

Hi,

We have two types of logs coming into the system and we need to store one type of logs for a longer duration then the other type.

I do understand that NLS can only drop logs based on index and we cannot delete based on any other parameter of the log (please let me know if we have any other options)

To handle this we were thinking to handle based on index so that we can drop the index based on the duration.

If we to do this how can we go about it? Our main goal is to have different storage duration based on the log type.


There are other similar request to this.
https://support.nagios.com/forum/viewto ... 38&t=41857
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Different log storage duration based on type

Post by cdienger »

I think the best way to go about this would be to configure the retention period to save the data for the longer of the two periods, and then periodically run a command manually or via a cron job to delete the older log types. The command would look like:

curl -XDELETE 'http://localhost:9200/logstash-2018.02. ... ype:syslog'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
technosol
Posts: 36
Joined: Mon May 07, 2018 11:46 am

Re: Different log storage duration based on type

Post by technosol »

Got it, we try out the method suggested. Thanks for the help
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Different log storage duration based on type

Post by cdienger »

Sounds good! We'll be here :)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked