-1

In my Mac OS, With fluentd I'm trying to read tcp events and write it to local directory.

Below is the td-agent.conf that I have created to open TCP port and writing to local.

  <!-- td-agent.conf-->
  <source>
    @type tcp
    @log_level "trace"
    tag "tcp.events"
    port 2201
    bind "0.0.0.0"
    delimiter "\\n"
    <parse>
      @type "regexp"
      expression "/^(?<field1>\\d+):(?<field2>\\w+)$/"
    </parse>
  </source>
  <match tcp.events>
    @type file
    path "/Users/logs/outputlog"
    <buffer time>
      path "/Users/logs/outputlog"
    </buffer>
  </match>

To test, I was sending the tcp packages to the port (2201) using tools like telnet and netcat. But the terminal don't return after connecting to the ports. It stays there with out any response.

Checked the verbose of telnet / netcat. No luck.

I expect TCP to connect and get the data logged in fluentd logs. But connection is getting established to the port but data is not written into log or the control of tcp connection is not returned back to terminal.

Ram
  • 103
  • 6

1 Answers1

0

Add the following to your conf file.

<source>
  @type forward
  port 24224
  bind 0.0.0.0
</source>

https://docs.fluentd.org/input/forward

Sreyas
  • 744
  • 1
  • 7
  • 25