geoip conflict
Re: geoip conflict
ok ill give it a shot
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Re: geoip conflict
Keep us posted. One other thing too - I was able to get similar results when the geoip lines were added:
In my case it was failing because the dat file didn't exist. The database line isn't necessary so it may be worth testing without this part of the config and/or make sure that /usr/share/GeoIP/GeoLiteCity.dat exists and has write access set.
Code: Select all
geoip {
database => "/usr/share/GeoIP/GeoLiteCity.dat"
source => "IPAddress"
}As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: geoip conflict
how do I change the field IP to Ipaddress.
that database exists ion the servers, we are using so maybe it will work if I change the field.
The real problem here is that I am clueless when it comes to creating filters. If you guys would be kind enough to answer a few questions for me, it will go a long way towards me being able tyo create and troubleshoot filters like this myself. STOP LAUGHING! i know ya'll are laughing....
so here goes:
first, looking closely at this filter I see that it is listed with with one difference:
line 1
Line 2
Second, I know that Scott must be correct when he said :
my question is whats the difference between the two symbols? and why would it bomb out when I use the suggested correction Scott gave me, but work when I used { instead of the ]?
And third using the following as an example:
what does each term in that line do?
Thanks guys!
that database exists ion the servers, we are using so maybe it will work if I change the field.
The real problem here is that I am clueless when it comes to creating filters. If you guys would be kind enough to answer a few questions for me, it will go a long way towards me being able tyo create and troubleshoot filters like this myself. STOP LAUGHING! i know ya'll are laughing....
so here goes:
first, looking closely at this filter I see that it is listed with with one difference:
Code: Select all
match => { "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username: %{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""}
match => { "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username=%{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""}Code: Select all
"Username: %{USER:params}Code: Select all
"Username=%{USER:params}'You were putting your match in { instead of [
my question is whats the difference between the two symbols? and why would it bomb out when I use the suggested correction Scott gave me, but work when I used { instead of the ]?
And third using the following as an example:
Code: Select all
result=\"%{WORD:result}Thanks guys!
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
-
swolf
Re: geoip conflict
If you're trying to change one incoming field to another, I would just create another filter. So if the log is coming in with 'IP' as the field, we can do:benhank wrote:how do I change the field IP to Ipaddress.
Code: Select all
mutate {
replace => { "Ipaddress" => "%{IP}" }
}
Make sure this is happening before you use geoip.
In this case, the difference is just matching the literal text of the log line. If you have a log format where you use a colon, likeso here goes:
first, looking closely at this filter I see that it is listed with with one difference:line 1Code: Select all
match => { "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username: %{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""} match => { "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username=%{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""}Line 2Code: Select all
"Username: %{USER:params}Code: Select all
"Username=%{USER:params}
Code: Select all
result: "okay" IP: "127.0.0.1" action: "something"The difference here is that {} is referring to a logstash hash (which other languages call a 'map', 'dictionary', 'object', or 'associative array'), where [] is referring to an array (which other languages call a 'list' or 'vector'). Hashes have a list of keys pointing to values, and arrays are lists of just values.Second, I know that Scott must be correct when he said :'You were putting your match in { instead of [
my question is whats the difference between the two symbols? and why would it bomb out when I use the suggested correction Scott gave me, but work when I used { instead of the ]?
I actually disagree with Scott here about changing {} to [] in the grok/match filters. If we look at the documentation then your original lines were correct. You can change the "message" in match to be an array, but not the match itself.
I would read that asAnd third using the following as an example:what does each term in that line do?Code: Select all
result=\"%{WORD:result}
Code: Select all
match the literal characters result="
match according to the 'WORD' pattern, store it in the field 'result'
I'll also point out that this is a weird use of %{}. Most of the time, %{} is used to reference a particular field. For instance, I can do
Code: Select all
exec {
command => "bash /path/to/do/something.sh %{IP}"
}
Let us know if that all made sense, or if there are other questions.
Re: geoip conflict
You can save the IP to a field called Ipaddress with:
ip=\"%{IP:Ipaddress}
The different between line 1 and line 2 is the extra space and colon versus equal sign. This it to account for differences in logs where the log line may contain:
Username: jdoe
vs
Username=jdoe
The lines could be made better with some regex to account for both in a single pattern:
match => [ "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username((: ){1})*((=){1})*%{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""]
Using [ vs } is a matter of what exactly you're try to do. This for example:
tells Logstash to take the message field and try to match it against the pattern. And:
tells Logstash to try and match the event(typically the contents of the messages field) against a list of patterns.
this searches for the string "result=" followed by a word that is then stored in a field called "result"
Grok and logstash configs can be ...fun... and can take a moment to get used to. For more examples I would check out:
https://support.nagios.com/kb/article/n ... ew-98.html
https://assets.nagios.com/downloads/nag ... ilters.pdf
ip=\"%{IP:Ipaddress}
The different between line 1 and line 2 is the extra space and colon versus equal sign. This it to account for differences in logs where the log line may contain:
Username: jdoe
vs
Username=jdoe
The lines could be made better with some regex to account for both in a single pattern:
match => [ "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username((: ){1})*((=){1})*%{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""]
Using [ vs } is a matter of what exactly you're try to do. This for example:
Code: Select all
grok {
match => { "message" => "patternpatternpattern..."}
}Code: Select all
grok {
match => ["patternpatternpattern1...","patternpatternpattern2..."]
}Code: Select all
result=\"%{WORD:result}Grok and logstash configs can be ...fun... and can take a moment to get used to. For more examples I would check out:
https://support.nagios.com/kb/article/n ... ew-98.html
https://assets.nagios.com/downloads/nag ... ilters.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: geoip conflict
THANKS GUYS!
Thanks to everyone who pitched in on this! Im still working on it and will keep you all updated!
Thanks to everyone who pitched in on this! Im still working on it and will keep you all updated!
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Re: geoip conflict
Sound good!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: geoip conflict
this allows me to apply the config and seems to parse the data correctly, I think I have to wait for someone to connect with an external ip in order to get the geoip data, but looking good so far:
Code: Select all
if [host] == '172.30.100.226' {
grok {
match => { "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username: %{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""}
match => { "message" => "result=\"%{WORD:result}\" ip=\"%{IP:IP}\" action=\"%{WORD:action}\" params=\"Username=%{USER:params}\" user=\"%{USER:user}\" tenant=\"%{WORD:tenant}\""}
}
geoip {
database => "/usr/share/GeoIP/GeoLiteCity.dat"
source => "IP"
}
}
You do not have the required permissions to view the files attached to this post.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Re: geoip conflict
Glad to hear!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: geoip conflict
i have another question.
is there a way to force my newly created filter to work on logfiles created before I implemented the newly created filter?
That is If I create a new filter today, I want it to work on logfiles that were sent to NLS from say a month ago.
is there a way to force my newly created filter to work on logfiles created before I implemented the newly created filter?
That is If I create a new filter today, I want it to work on logfiles that were sent to NLS from say a month ago.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion