I want to copy the value of the host.hostname field to host.name or otherwise ensure that host.name takes this value.
I'm collecting syslog and auth data from a number of hosts on a single machine and shipping to Elastic Search from there via filebeat and the system module. The only issue is that visualizations and apps (e.g. SIEM app) default to looking at the host.name field for host information. The actual host from which data originates is in the files being ingested, and ends up in host.hostname.
I've tried using a couple of processors (copy-field, rename), but am not having much luck and getting very frustrated. Any guidance would be greatly appreciated.
OK! Some progress! I can overwrite the value in the host.name field with a value from another field using processors... I just can't figure out how to access the host.hostname field I guess?
Is that the sort of problem anyone can help me to solve? Is it just a matter of figuring out how to name the field at this stage of the game?
I see host.hostname in the JSON in the Discover tab, but maybe I need to call it something else in my filebeat.yml?
The issue seems to be that I cannot access the host.hostname field via processors. I have tried drop, copy_field, and rename. I can access/change most other fields, and I can see host.hostname in the JSON for documents associated with the index:
Sorry for the slow response. I was away from work for a couple of days without reliable access.
Adding the add_host_metadata processor brings a lot of additional information about the device shipping data into my documents/JSON, but does not make the host.hostname field available to rename.
Processors now appear to read host.hostname as containing the value in the host.name field, which is not the case when I look at the JSON.
The behaviour of this processor is very unexpected:
A new_name field will be created, containing the value of host.name, and both host.hostname and host.name will remain as document fields... which is to say, no rename operation takes place at all. I'm fairly stumped.
I feel like I have a working solution. It's not perfect, but adding a processor to the ingest pipeline accomplishes the task I need.
I added a set processor to the ingest pipelines for the auth and syslog data, and am now able to interact with the SIEM app sensibly and see all my hosts.
For anyone finding this thread and needing to accomplish a similar task, consider editing either the default pipelines (JSON files in /user/share/filebeat/MODULE_NAME/SUB_MODULE/ingest/pipeline.json) or updating exiting pipelines (https://www.elastic.co/guide/en/elasticsearch/reference/current/put-pipeline-api.html), depending upon your set up.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.