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

extract_placeholders cannot extract ${hostname} properly #1353

Closed
okkez opened this issue Dec 7, 2016 · 0 comments · Fixed by #1357
Closed

extract_placeholders cannot extract ${hostname} properly #1353

okkez opened this issue Dec 7, 2016 · 0 comments · Fixed by #1357
Assignees

Comments

@okkez
Copy link
Contributor

okkez commented Dec 7, 2016

  • fluentd v0.14.9
  • Debian GNU/Linux

config:

<source>
  @type dummy
  tag raw.dummy
  dummy [
  {"host":"66.102.9.80", "message":"test1"},
  {"host":"66.102.9.80", "message":"test2"},
  {"host":"66.102.9.80", "message":"test3"},
  {"host":"66.102.9.80", "message":"test4"},
  {"host":"66.102.9.80", "message":"test5"}
  ]
</source>

<match raw.**>
  @type geoip
  tag ${tag[0]}.geoip.${hostname}
  geoip_lookup_key  host
  #geoip_database    "/path/to/your/GeoIPCity.dat"
  <record>
    city            ${city["host"]}
    latitude        ${latitude["host"]}
    longitude       ${longitude["host"]}
    country_code3   ${country_code3["host"]}
    country         ${country_code["host"]}
    country_name    ${country_name["host"]}
    dma             ${dma_code["host"]}
    area            ${area_code["host"]}
    region          ${region["host"]}
  </record>
  <buffer tag, hostname>
    flush_interval    1s
  </buffer>
  <inject>
    hostname_key hostname
  </inject>
</match>

<match raw.**>
  @type stdout
</match>

https://github.com/okkez/fluent-plugin-geoip/blob/migrate-to-v0.14-api/lib/fluent/plugin/out_geoip.rb

I'm trying to migrate fluent-plugin-geoip's out_geoip to Fluentd v0.14 API.
I want to extract placeholders ${hostname} using hostname field added by inject plugin helper.

Expected behavior:

tag will include hostname added by inject plugin helper.

Actual behavior:

tag does not include hostname added by inject plugin helper.

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

Successfully merging a pull request may close this issue.

2 participants