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

how to set custom tag in filebeat output.elasticsearch _stream_fields #6267

Closed
3 tasks
dw130 opened this issue May 14, 2024 · 2 comments
Closed
3 tasks

how to set custom tag in filebeat output.elasticsearch _stream_fields #6267

dw130 opened this issue May 14, 2024 · 2 comments
Labels
question The question issue

Comments

@dw130
Copy link

dw130 commented May 14, 2024

Is your question request related to a specific component?

VictoriaLogs

Describe the question in detail

hi,use filebeat to collect log to victoriaLog
use the sample conf
https://docs.victoriametrics.com/victorialogs/data-ingestion/filebeat/

output.elasticsearch:
hosts: ["http://localhost:9428/insert/elasticsearch/"]
parameters:
_msg_field: "message"
_time_field: "@timestamp"
_stream_fields: "host.hostname,log.file.path"

How to add some custom tag in the _stream_fields?
for example add region = xx1, app = xx2 into the _stream_fields

Thanks

Troubleshooting docs

@dw130 dw130 added the question The question issue label May 14, 2024
@AndrewChubatiuk
Copy link
Contributor

hey @dw130
it's possible to set custom fields in general options of filebeat (or for each input separately) and use them in elasticsearch output like this:

fields:
    region: xx1
    app: xx2
output.elasticsearch:
   hosts: ["http://localhost:9428/insert/elasticsearch/"]
   parameters:
      _msg_field: "message"
      _time_field: "@timestamp"
      _stream_fields: "host.hostname,log.file.path,fields.region,fields.app"

@dw130
Copy link
Author

dw130 commented May 15, 2024

Thanks,It works @AndrewChubatiuk

@dw130 dw130 closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The question issue
Projects
None yet
Development

No branches or pull requests

2 participants