Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filebeat source:unknown, no agent.hostname field #13254

Closed
NomAnor opened this issue Aug 17, 2022 · 0 comments · Fixed by #13895
Closed

Filebeat source:unknown, no agent.hostname field #13254

NomAnor opened this issue Aug 17, 2022 · 0 comments · Fixed by #13895
Assignees

Comments

@NomAnor
Copy link

NomAnor commented Aug 17, 2022

I'm testing graylog with the filebeat journald input and the source field shows unknown.
In #6501 the same problem was fixed because of a rename in newer Beats versions.

Looking through the Beat documentation it looks like the agent.hostname field is deprecated and the agent.name field should be used: https://www.elastic.co/guide/en/beats/filebeat/current/exported-fields-beat-common.html

Expected Behavior

Source field shows the hostname of the filebeat agent.

Current Behavior

Source field shows "unknown".

Possible Solution

Extend the source parsing such that agent.name and agent.id are also considered.

final String hostname = agentOrBeat.path("hostname").asText(BEATS_UNKNOWN);

Steps to Reproduce (for bugs)

  1. Run the docker-compose.yml from the Graylog Documentation
  2. Configure beats input
  3. Run filebeat using the journald input

Your Environment

Arch Linux with filebeat 8.3.3 built from the AUR package.

Filebeat config:

filebeat.inputs:
  - type: journald
    id: journal

filebeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

setup.template.settings:
  index.number_of_shards: 1

output.logstash:
  hosts:
    - "localhost:5044"

processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~
  • Graylog Version: 4.2
  • Java Version:
  • Elasticsearch Version: 7.10.2
  • MongoDB Version: 4.2
  • Operating System: Arch Linux
  • Browser version: Firefox 103.0.2
@NomAnor NomAnor added the bug label Aug 17, 2022
@bernd bernd added the triaged label Aug 24, 2022
@bernd bernd self-assigned this Nov 7, 2022
bernd added a commit that referenced this issue Nov 7, 2022
bernd added a commit that referenced this issue Nov 7, 2022
In beats v8 the "agent.hostname" field got renamed to "agent.name".

Fixes #13254
thll pushed a commit that referenced this issue Nov 7, 2022
* Fix "source" field for beats version >= 8

In beats v8 the "agent.hostname" field got renamed to "agent.name".

Fixes #13254

* Add changelog entry
bernd added a commit that referenced this issue Nov 7, 2022
* Fix "source" field for beats version >= 8

In beats v8 the "agent.hostname" field got renamed to "agent.name".

Fixes #13254

* Add changelog entry

(cherry picked from commit 63bc4fe)
bernd added a commit that referenced this issue Nov 14, 2022
* Fix "source" field for beats version >= 8

In beats v8 the "agent.hostname" field got renamed to "agent.name".

Fixes #13254

* Add changelog entry

(cherry picked from commit 63bc4fe)
bernd added a commit that referenced this issue Dec 9, 2022
* Fix "source" field for beats version >= 8

In beats v8 the "agent.hostname" field got renamed to "agent.name".

Fixes #13254

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants