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 get the data in the array by fluent? #23

Open
rljie opened this issue Dec 18, 2019 · 0 comments
Open

How to get the data in the array by fluent? #23

rljie opened this issue Dec 18, 2019 · 0 comments

Comments

@rljie
Copy link

rljie commented Dec 18, 2019

Framework
filebeat --> kafka --> fluentd --> elasticsearch

Describe the problem
filebeat comes with an array of tags, but fluentd doesn't filter out!
The filter in logstash is

mutate {
     add_field =>  {
           "city" => "%{[tags][0]}"
           "ip" => "%{[tags][1]}"
     }
}

filebeat output configuration

output.kafka:
   hosts: ["120.0.0.1:9092"]
   topic: test
   required_acks: 1
tags: ["xinyi", "19.18.14.168"]
Fluentd Filter Configuration
<filter **>
   @type record_transformer
   enable_ruby true
   auto_typecast true
   <record>
      city %{[tags][0]}
      ip %{[tags][1]}
   </record>
</filter>

result
The city and IP fields inserted into es are %{[tags][0]} and %{[tags][1}
So, filtering didn't work, looking forward to answer, thanks

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

No branches or pull requests

1 participant