Filters not written to configuration

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
gabe
Posts: 3
Joined: Fri Oct 17, 2014 11:36 am

Filters not written to configuration

Post by gabe »

Hello, all:

I'm evaluating Log Server and am trying to add a Redis input filter. Via the Administration section of the GUI, I've added an input filter that looks like this:

Code: Select all

redis {
    host => "127.0.0.1"
    data_type => "list"
    key => "logstash"
    codec => json
}
After saving the filter and applying the configuration, the filter didn't seem to be working. Upon further investigation, I notice that no new filter has been added to /usr/local/nagioslogserver/logstash/etc/conf.d/000_inputs.conf. Strangely, when I use the GUI to view all of the filters, my Redis filter is shown:

Code: Select all

input {
    syslog {
        type => 'syslog'
        port => 5544
    }
    tcp {
        type => 'eventlog'
        port => 3515
        codec => json {
            charset => 'CP1252'
        }
    }
    tcp {
        type => 'import_raw'
        tags => 'import_raw'
        port => 2056
    }
    tcp {
        type => 'import_json'
        tags => 'import_json'
        port => 2057
        codec => json
    }
    redis {
        host => "127.0.0.1"
        data_type => "list"
        key => "logstash"
        codec => json
    }
}
I'm at a loss as to why the new filter is not being written to the config file. Anyone else running into issues with new custom filters being properly written to the logstash config?

Thanks,

Gabe
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Filters not written to configuration

Post by eloyd »

Not to state the obvious, but have you "verified" your config before "saving" and "applying" it?
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
gabe
Posts: 3
Joined: Fri Oct 17, 2014 11:36 am

Re: Filters not written to configuration

Post by gabe »

Yes, I did verify the config and it verified fine. I also confirmed that if I simply modify 000_inputs.conf with the additions I want and restart logstash, logstash successfully uses my redis input, my redis queue is drained as expected, and the desired entries appear in Log Server when I search for them.

Gabe
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Filters not written to configuration

Post by scottwilkerson »

Did you add it as an input or a filter?

Inputs are listed in
/usr/local/nagioslogserver/logstash/etc/conf.d/000_inputs.conf

Filters are listed in
/usr/local/nagioslogserver/logstash/etc/conf.d/500_filters.conf

Also, how many instances are in your cluster?

What are the permissions on the file

Code: Select all

ls -l /usr/local/nagioslogserver/logstash/etc/conf.d/000_inputs.conf
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
gabe
Posts: 3
Joined: Fri Oct 17, 2014 11:36 am

Re: Filters not written to configuration

Post by gabe »

Scott:

Thanks for your reply. I added it as an input as shown in my original post. My cluster is two instances; neither of them seem to get the new input. Perms and ownership shown here:

# ls -l /usr/local/nagioslogserver/logstash/etc/conf.d/
total 12
-rw-r--r--. 1 apache apache 636 Oct 30 15:51 000_inputs.conf
-rw-r--r--. 1 apache apache 957 Oct 30 15:51 500_filters.conf
-rw-r--r--. 1 apache apache 493 Oct 30 15:51 999_outputs.conf

The date shown is that when I installed Log Server, so nothing has changed with the logstash config since.

Thanks,

Gabe
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Filters not written to configuration

Post by tmcdonald »

I've got the following:

Code: Select all

-rwxrwxr-x 1 nagios nagios 722 Nov  5 16:51 000_inputs.conf
-rwxrwxr-x 1 nagios nagios 978 Nov  5 16:51 500_filters.conf
-rwxrwxr-x 1 nagios nagios 493 Nov  5 16:51 999_outputs.conf
Do you have any sort of umask in place?

Code: Select all

umask
Former Nagios employee
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Filters not written to configuration

Post by scottwilkerson »

apache:apache definitely isn't correct...

lets start by running
chown nagios:nagios -R /usr/local/nagioslogserver
then try to apply configuration again
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: Filters not written to configuration

Post by nozlaf »

also have this issue, I've changed the permissions on the folders, verified they are correct and the issue persists

-rw-rw-r-- 1 nagios nagios 787 Nov 10 20:52 000_inputs.conf
-rw-rw-r-- 1 nagios nagios 220 Nov 10 20:52 500_filters.conf
-rw-rw-r-- 1 nagios nagios 493 Nov 10 20:52 999_outputs.conf

When I apply the config I can confirm that the filters file gets overwritten with the same empty contents

-rw-rw-r-- 1 nagios nagios 220 Nov 10 21:09 500_filters.conf

Code: Select all

#
# Logstash Configuration File
# Dynamically created by Nagios Log Server
#
# DO NOT EDIT THIS FILE. IT WILL BE OVERWRITTEN.
#
# Created Mon, 10 Nov 2014 21:09:08 -0500
#

#
# Global filters
#



#
# Local filters
#
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: Filters not written to configuration

Post by nozlaf »

So i've done some investigation into the issue as I didn't want to wait until tomorrow for a response from anyone

seems like "validate" doesnt really work at all and is pretty much useless / misleading

sometimes it brings up errors but generally it validates and says everything is fine, however if you try and apply the config you will get thrown to the configuration snapshots page with a message about the delete request being processed this indicates that there is a config issue.
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Filters not written to configuration

Post by lmiltchev »

Let's clarify - when you try to add a new filter under the "per instance" page, the filter is not added (nothing appears on the "per instance" page) but the "global" configs get overwritten, correct?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked