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

Can't have multiple input syslog #5368

Closed
endersonmaia opened this issue Feb 2, 2019 · 0 comments · Fixed by #5372
Closed

Can't have multiple input syslog #5368

endersonmaia opened this issue Feb 2, 2019 · 0 comments · Fixed by #5372
Labels
area/syslog bug unexpected problem or unintended behavior
Milestone

Comments

@endersonmaia
Copy link

endersonmaia commented Feb 2, 2019

Relevant telegraf.conf:

telegraf.conf

[[inputs.syslog]]
  server = "udp://localhost:6514"
[[inputs.syslog]]
  server = "tcp://localhost:6514"

[[outputs.file]]
  files = [ "stdout" ]

System info:

I have a docker stack for a simple telegraf that listens for syslog packets and outputs to stdout

docker-compose.yml

version: '3.6'

networks:
  monitoring:

configs:
  telegraf.conf:
    external: true

services:
  # Define a Telegraf service
  telegraf:
    image: telegraf
    configs:
      - source: telegraf.conf
        target: /etc/telegraf/telegraf.conf
    networks:
      - monitoring
    ports:
      - "8092:8092/udp"
      - "8094:8094"
      - "8125:8125/udp"
      - "6514:6514"
      - "6514:6514/udp"

Steps to reproduce:

  1. Run this stack
docker config create telegraf.conf ./telegraf.conf
docker stack deploy -c docker-compose.yml tick
  1. Se the logs

docker service logs tick_telegraf

Expected behavior:

According to the documentation, it should be possible to have multiple input plugins.

I'm getting the following logs and the container keeps restarting.

Actual behavior:

 I! Starting Telegraf 1.9.3,
 I! Using config file: /etc/telegraf/telegraf.conf,
 I! Loaded inputs: inputs.syslog inputs.syslog,
 I! Loaded aggregators: ,
 I! Loaded processors: ,
 I! Loaded outputs: file,
 I! Tags enabled: host=e4b1b569c08d,
 I! [agent] Config: Interval:10s, Quiet:false, Hostname:"e4b1b569c08d", Flush Interval:10s,
 E! [agent] Service for input inputs.syslog failed to start: missing protocol within address ':6514',
 E! [telegraf] Error running agent: missing protocol within address ':6514',

Additional info:

When I try just with a single [[input.syslog]] it works fine.

Single TCP

After starting the stack with a single TCP

[[inputs.syslog]]
  server = "tcp://localhost:6514"

after running echo "57 <13>1 2018-10-01T12:00:00.0Z example.org root - - - test" | nc 127.0.0.1 6514

I get

2019-02-02T23:16:23Z I! Starting Telegraf 1.9.3,
2019-02-02T23:16:23Z I! Using config file: /etc/telegraf/telegraf.conf,
2019-02-02T23:16:23Z I! Loaded inputs: inputs.syslog,
2019-02-02T23:16:23Z I! Loaded aggregators: ,
2019-02-02T23:16:23Z I! Loaded processors: ,
2019-02-02T23:16:23Z I! Loaded outputs: file,
2019-02-02T23:16:23Z I! Tags enabled: host=f158f7e23400,
2019-02-02T23:16:23Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"f158f7e23400", Flush Interval:10s,
syslog,appname=root,facility=user,host=f158f7e23400,hostname=example.org,severity=notice version=1i,severity_code=5i,facility_code=1i,timestamp=1538395200000000000i,message="test" 1549149411602523900,
syslog,appname=root,facility=user,host=f158f7e23400,hostname=example.org,severity=notice version=1i,severity_code=5i,facility_code=1i,timestamp=1538395200000000000i,message="test" 1549149444157521600,

Single UDP

With UDP it works with some errors in the plugin, but it seems to get the message (maybe another bug?).

After starting the stack with a single UDP

after running echo "<13>1 2018-10-01T12:00:00.0Z example.org root - - - test" | nc -u 127.0.0.1 6514

[[inputs.syslog]]
  server = "udp://localhost:6514"
2019-02-02T23:12:19Z I! Starting Telegraf 1.9.3,
2019-02-02T23:12:19Z I! Using config file: /etc/telegraf/telegraf.conf,
2019-02-02T23:12:19Z I! Loaded inputs: inputs.syslog,
2019-02-02T23:12:19Z I! Loaded aggregators: ,
2019-02-02T23:12:19Z I! Loaded processors: ,
2019-02-02T23:12:19Z I! Loaded outputs: file,
2019-02-02T23:12:19Z I! Tags enabled: host=877526f8951d,
2019-02-02T23:12:19Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"877526f8951d", Flush Interval:10s,
2019-02-02T23:12:22Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
2019-02-02T23:12:22Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
2019-02-02T23:12:22Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
2019-02-02T23:12:22Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
syslog,appname=root,facility=user,host=877526f8951d,hostname=example.org,severity=notice facility_code=1i,timestamp=1538395200000000000i,message="test",version=1i,severity_code=5i 1549149142336317200,
2019-02-02T23:12:36Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
2019-02-02T23:12:36Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
2019-02-02T23:12:36Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
2019-02-02T23:12:36Z E! [inputs.syslog]: Error in plugin: expecting a priority value within angle brackets [col 0],
syslog,appname=root,facility=user,host=877526f8951d,hostname=example.org,severity=notice version=1i,severity_code=5i,facility_code=1i,timestamp=1538395200000000000i,message="test" 1549149156288226500,
@danielnelson danielnelson added this to the 1.9.4 milestone Feb 4, 2019
@danielnelson danielnelson added bug unexpected problem or unintended behavior area/syslog labels Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/syslog bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants