Variable %{hostname} not being honored in azure_object_key_format

200 views
Skip to first unread message

krishn...@gmail.com

unread,
Feb 15, 2018, 8:17:46 AM2/15/18
to Fluentd Google Group
Hello,
We are using fluent-plugin-azurestorage plugin.
For some reason Variable  %{hostname} not being honored in azure_object_key_format.
Output files are names as "20180215-11_0-.json" instead of "20180215-11_0-swstoreprod4.json"

Following are the version details:

OS ubuntu14.04

fluent-plugin-azurestorage (0.1.0)

ubuntu@swstoreprod4:~$ ruby -v

ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]

ubuntu@swstoreprod4:~$ fluentd -v
/home/ubuntu/.rvm/gems/ruby-2.4.1/gems/fluentd-1.1.0/lib/fluent/supervisor.rb:735:in `initialize': No such file or directory @ rb_sysopen - /etc/fluent/fluent.conf (Errno::ENOENT)
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/gems/fluentd-1.1.0/lib/fluent/supervisor.rb:735:in `open'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/gems/fluentd-1.1.0/lib/fluent/supervisor.rb:735:in `read_config'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/gems/fluentd-1.1.0/lib/fluent/supervisor.rb:451:in `run_supervisor'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/gems/fluentd-1.1.0/lib/fluent/command/fluentd.rb:310:in `<top (required)>'
    from /home/ubuntu/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/ubuntu/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/gems/fluentd-1.1.0/bin/fluentd:8:in `<top (required)>'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/bin/fluentd:23:in `load'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/bin/fluentd:23:in `<main>'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
    from /home/ubuntu/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

ubuntu@swstoreprod4:~$ td --version
0.15.2

ubuntu@swstoreprod4:~$ hostname
swstoreprod4

td-agent.conf file snippet:


<match file.swym.bi.sessions>
  type file
  path /var/log/td-agent/swstore-sessions
  time_slice_format %Y%m%d%H
  time_slice_wait 10m
  time_format %Y-%m-%d %H:%M:%S
  time_key time
  ##include_time_key true
  utc
</match>



<match swym.bi.sessions>
  type azurestorage

  azure_storage_account    <>
  azure_storage_access_key <>
  azure_container          bi-logs
  azure_storage_type       blob
  store_as                 json
  auto_create_container    true
  path                     swym.bi.sessions/
  azure_object_key_format  %{path}%{time_slice}_%{index}-%{hostname}.%{file_extension}
  buffer_path              /var/log/td-agent/azurestorage/sessions

  time_slice_format        %Y%m%d-%H
  time_slice_wait          10m
  utc

  flush_interval           60m

  output_tag               false
  output_time              false
  buffer_chunk_limit       1000k
</match>


Can someone please assist here?
Thanks,
Krishna

Mr. Fiber

unread,
Feb 23, 2018, 3:41:13 AM2/23/18
to Fluentd Google Group
From the source code, azurestorage plugin seems to not support %{hostname} because mixin is removed.
You can use embed ruby code feature instead: https://docs.fluentd.org/v1.0/articles/config-file#embedded-ruby-code


Masahiro

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

krishn...@gmail.com

unread,
Feb 23, 2018, 5:57:22 AM2/23/18
to Fluentd Google Group
Thanks Masahiro,
Krishna
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages