Skip to content

Instantly share code, notes, and snippets.

@devx
Created January 10, 2020 00:22
Show Gist options
  • Save devx/69dee43fc7e8566517273e54919dcf11 to your computer and use it in GitHub Desktop.
Save devx/69dee43fc7e8566517273e54919dcf11 to your computer and use it in GitHub Desktop.
Generate a unique hash of every event to prevent duplicates
# @see https://github.com/uken/fluent-plugin-elasticsearch#generate-hash-id
<filter **>
@type elasticsearch_genid
hash_id_key _hash
</filter>
# Apply value from filter to id_key field
# Elasticsearch also doesn't like field names with `_` so remove it.
<match **>
@type elasticsearch
hosts elasticsearch.local:9200
[..]
id_key _hash
remove_keys _hash
[..]
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment