Skip to content

Record Modifer on Windows Server doesn't execute Ruby code #72

Description

@JPGrieb

I am running the Fluentd agent on Windows Server 2016.
I also installed the plug-in "fluent-plugin-grafana-loki" to allow me to output messages to loki.
I'm attempting to add the hostname as a label to my messages.
I found that when type=file or type=loki, the ruby code in the filter statements below don't work (don't even seem to run):

<match myfile>
  @type file
  path /var/log/td-agent/access
  <label>
    host
  </label>
</match>

<filter myfile>
  @type record_modifier
  <record>
    host "#{Socket.gethostname}"
  </record>
</filter>

<filter myfile>
  @type record_modifier
  prepare_value require 'socket'; @name = Socket.gethostname
  <record>
    host ${@name.downcase}
  </record>
</filter>

Any suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions