Trying to set this up. Follow the doc to the letter. I was able to get the geo fields, <field>_geolocation, when i ran the command:
nc -w1 <graylog_host> 5555 <<< '8.8.8.8'
Unfortunately it does not work with normal logs that come in. On my input i have an extractor that copies the IP from the message into gl2_remote_ip field, which works.
Trying to extract data from message into gl2_remote_ip, leaving the original intact.
Condition
Will only attempt to run if the message matches the regular expression from ([0-9]+.[0-9]+.[0-9]+.[0-9]+|\S+)(\s|:\s)
Configuration
regex_value: from ([0-9]+.[0-9]+.[0-9]+.[0-9]+|\S+)(\s|:\s)
Also set GeoIP Resolver to last (3) in “Message Processors Configuration”.
# Processor Status
1 Pipeline Processor active
2 Message Filter Chain active
3 GeoIP Resolver active
This is how the Plugin is configured:
Enabled: yes
Database type: City database
Database path: /etc/graylog/server/GeoLite2-City.mmdb
Does the gl2_remote_ip field contain only the IP address and no white-spaces or other characters around it?
Yes, only the IP. No special chars or white-spaces. Copied field from exactly from terminal just replaced IP.
"gl2_remote_ip": "1.1.1.1",
I tried again for sanity’s sake the command nc -w1 localhost 5555 <<< '91.200.12.76' and it works but it goes to the message field which then creates the message_geo* fields. (that’s not my public IP, it’s an ip that was trying to get in from ukrain)
Please use another field name than gl2_remote_ip to store the IP addresses you want to run the GeoIP processor on.
Upon inspecting the code of the Map Widget plugin, I realized that the GeoIP processor will ignore any “internal” field (i. e. any field starting with gl2_). We should probably document that better.
Now when i have GeoIP “Message Processors” Enabled I get this error under /system/indices/failures
{“type”:“mapper_parsing_exception”,“reason”:“failed to parse”,“caused_by”:{“type”:“illegal_argument_exception”,“reason”:“Can’t parse [index] value [not_analyzed] for field [message_country_code], expected [true] or [false]”}}
What am i doing wrong?
I have the exact same settings as those mentioned on first comment
So… when i rebuild graylog2.3 and elasticv5.5 on another box geoip worked like a charm.
I decided to remove and reinstall the applications on the offending server and geoip works as expected…