Hi guys, I'm trying to use filebeat's geoLocation, but it just doesn't work.
None of the fields appear, neither in archives nor in alerts.
First I tried using the default pipelines (
https://github.com/wazuh/wazuh/blob/4.1/extensions/filebeat/7.x/wazuh-module/alerts/ingest/pipeline.json). Didn't work, so I created a new one, like this:
https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-geoip.html#filebeat-configuring-geoip My pipeline named geoLocation:
[
{
"json": {
"field": "message",
"add_to_root": true
}
},
{
"geoip": {
"field": "data.srcip",
"target_field": "GeoLocation",
"properties": [
"city_name",
"country_name",
"region_name",
"location"
],
"ignore_missing": true,
"ignore_failure": true
}
},
{
"geoip": {
"field": "data.win.eventdata.ipAddress",
"target_field": "GeoLocation",
"properties": [
"city_name",
"country_name",
"region_name",
"location"
],
"ignore_missing": true,
"ignore_failure": true
}
},
{
"geoip": {
"field": "data.aws.sourceIPAddress",
"target_field": "GeoLocation",
"properties": [
"city_name",
"country_name",
"region_name",
"location"
],
"ignore_missing": true,
"ignore_failure": true
}
},
{
"geoip": {
"field": "data.gcp.jsonPayload.sourceIP",
"target_field": "GeoLocation",
"properties": [
"city_name",
"country_name",
"region_name",
"location"
],
"ignore_missing": true,
"ignore_failure": true
}
},
{
"date": {
"field": "timestamp",
"target_field": "@timestamp",
"formats": [
"ISO8601"
],
"ignore_failure": false
}
},
{
"date_index_name": {
"field": "timestamp",
"date_rounding": "d",
"index_name_prefix": "{{fields.index_prefix}}",
"index_name_format": "yyyy.MM.dd",
"ignore_failure": false
}
},
{
"remove": {
"field": "message",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "ecs",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "beat",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "input_type",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "tags",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "count",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "@version",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "log",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "offset",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "type",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "host",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "fields",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "event",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "fileset",
"ignore_missing": true,
"ignore_failure": true
}
},
{
"remove": {
"field": "service",
"ignore_missing": true,
"ignore_failure": true
}
}
]
My filebeat.yml:
output.elasticsearch:
hosts: ["IP"]
pipeline: geoLocation
protocol: https
username: "username"
password: "pass"
ssl.certificate_authorities:
- /path/cert
ssl.certificate: "/path/crt"
ssl.key: "/path/key"
setup.template.json.enabled: true
setup.template.json.path: '/etc/filebeat/wazuh-template.json'
setup.template.overwrite: true
setup.ilm.overwrite: true
setup.ilm.enabled: false
filebeat.modules:
- module: wazuh
alerts:
enabled: true
archives:
enabled: true