IP Range in Input

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
comfone
Posts: 127
Joined: Fri May 01, 2015 3:28 am

IP Range in Input

Post by comfone »

Hi All
Is it possible to configure a list of IPs for the Input in Naigos Log Server?
We would like to tag the syslogs coming from some IPs as "netwok-syslog" .
We can't use Port, as we are not allowed to change the default Port for syslog in some Network Devices.
Thank you in advance for your help.
Cheers,
Murat
Last edited by comfone on Thu May 19, 2016 4:19 am, edited 1 time in total.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: IP Range in Input

Post by eloyd »

Yes, you can match on incoming IP and then tag that in the input filter. However, it may be easier to send the data pre-tagged from the sending side. The easiest way is to use the included script on the home page of your NLS installation (http://xx.xx.xx.xx/nagioslogserver/source-setup) which goes like this:

Code: Select all

curl -s -O http://xx.xx.xx.xx/nagioslogserver/scripts/setup-linux.sh
bash setup-linux.sh -s xx.xx.xx.xx -p 5544 -f "/var/log/httpd/error_log" -t apache_error
bash setup-linux.sh -s xx.xx.xx.xx -p 5544 -f "/var/log/httpd/access_log" -t apache_access
The tag is the -t part at the end, which you can change to your heart's content.

Or, you can go command-line and change the /etc/rsyslog.d/ files to change the tag to match what you need on each machine.

Personally, I'd go with the last option since it's guaranteed to work and you don't have to manage changing IPs from within a grok filter inside the NLS input filters.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: IP Range in Input

Post by bwallace »

Thanks eloyd - OP, lets us know if there are any other questions -
Be sure to check out the Knowledgebase for helpful articles and solutions!
comfone
Posts: 127
Joined: Fri May 01, 2015 3:28 am

Re: IP Range in Input

Post by comfone »

Hi
Thank you for the information and and help.
Can you still show me how to tag it on the Input.
Thank you.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: IP Range in Input

Post by eloyd »

Short version: Go to Administration | Global Configuration and look at your filters. You'll probably want to add another filter that matches data according to source and then mutates it to add a new tag. Details can be found at https://www.elastic.co/guide/en/logstas ... te-add_tag
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: IP Range in Input

Post by hsmith »

I was looking for a way to do it in the input itself and didn't come across much. The filter method is likely how it's going to need to be done.
Former Nagios Employee.
me.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: IP Range in Input

Post by eloyd »

Unless you come in on different ports, which was specifically not allowed, you cannot tag it differently in the input. Must be done in filter. Which is pretty easy - if ip matches whatever, then mutate and add tag whatever_tag.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: IP Range in Input

Post by hsmith »

Correct. I'm not sure why they don't have something like that in LS inputs, it would be neat.
Former Nagios Employee.
me.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: IP Range in Input

Post by eloyd »

Because LS inputs are not the same as LS filters. :) LS works by bringing data in (input), passing it through filters (filter) and then sending it to an output (in NLS's case, elasticsearch). So having inputs do filtering is just plain crazy!!! :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: IP Range in Input

Post by hsmith »

Well, yes. I can see arguments for both sides. :)
Former Nagios Employee.
me.
Locked