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

Telegraf agent not polling the input as per the configured interval #3492

Closed
shansudhakar opened this issue Nov 21, 2017 · 8 comments
Closed

Comments

@shansudhakar
Copy link

shansudhakar commented Nov 21, 2017

Directions

GitHub Issues are reserved for actionable bug reports and feature requests.
General questions should be asked at the InfluxData Community site.

Before opening an issue, search for similar bug reports or feature requests on GitHub Issues.
If no similar issue can be found, fill out either the "Bug Report" or the "Feature Request" section below.
Erase the other section and everything on and above this line.

Please note, the quickest way to fix a bug is to open a Pull Request.

Bug report

Relevant telegraf.conf:

[agent]
interval = "60s"
round_interval = true
metric_batch_size = 10000
metric_buffer_limit = 100000
collection_jitter = "0s"
flush_jitter = "0s"
precision = ""

[[outputs.file]]
files = ["stdout", "/tmp/metrics.out"]
data_format = "influx"

[[outputs.kafka]]
brokers = ["measure-kafka-tgt-ttc.target.com:9092"]
required_acks = 0
topic = "metric-influx-tgt-ttc-prod-platform-engineering-mft"

# Stream and parse log file(s).

[[inputs.logparser]]
files = ["/apps/mft/shared/logs/MFT_CheckNode.log"]
from_beginning = true

[inputs.logparser.grok]
patterns = ["%{LastHeartBeat}"]
measurement = "mft_lastbeat_prod"
custom_patterns = '''
LastHeartBeat %{TIMESTAMP_ISO8601:timestamp}|%{WORD:node:tag}.+|%{BASE10NUM:cstatus1:int}.* %{BASE10NUM:cstatus2:int}.* %{BASE10NUM:cstatus3:int}
'''

System info:

telegraf]# telegraf -version
Telegraf v1.4.3 (git: release-1.4 b473b6a)

telegraf]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)

Steps to reproduce:

  1. Provide input and write the output to log/kafka topic
  2. Restart the telegraf agent

Expected behavior:

Poll every 60s of the input log provided

Actual behavior:

Its reading the input only when telegraf agent restarted, that too with "from_beginning = true"

Additional info:

"from_beginning = false" not at all working to get the delta from the input log file

[Include gist of relevant config, logs, etc.]
[<script src="https://gist.github.com/shansudhakar/c74bf66797d86cc83f4103033af9ada3.js"></script>]
[<script src="https://gist.github.com/shansudhakar/e3eacb043d5c50fe656effbe54b0ac36.js"></script>]
[<script src="https://gist.github.com/shansudhakar/9b93fc90ab0aba2952c97ac7251e4bdb.js"></script>]

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

Current behavior:

Desired behavior:

Use case: [Why is this important (helps with prioritizing requests)]

Read multiple logs at a frequency and display status of infra on grafana dashboard

@danielnelson
Copy link
Contributor

The logparser input is a so called service input, which are event driven. Instead of using the interval these inputs generate metrics when events occur, in the case of logparser this is when the logfile is appended too.

If you have from_beginning = true, on startup the entire file will be read and processed, otherwise only newly added lines will be detected.

@shansudhakar
Copy link
Author

@danielnelson I understand the functionality of the logparser, however the issue is agent/plugin not reading the logfile whenever its appended with new entries. It reads only with "from_beginning = true" and agent is restarted. Our requirement is to have "from_beginning = false" and read/process the appended entries into the log file input.

@danielnelson
Copy link
Contributor

If logparser is not picking up new lines, but they are parsed when starting up with from_beginning = true then it is a bug. We do know of one bug with change detection #2847, maybe this is what you are seeing?

@shansudhakar
Copy link
Author

@danielnelson #2847 seems to be a different issue with new file not detected after refresh/rotate.

@danielnelson
Copy link
Contributor

Are you able to reliably reproduce this issue? If so can you try to create a list of the smallest number of steps to reproduce?

BTW, when 1.5 is released or with the nightlies you can also use method = "poll" to poll the file for changes instead of using inotify.

@danielnelson danielnelson reopened this Dec 1, 2017
@shansudhakar
Copy link
Author

which is the correct config file to use:
/etc/telegraf/telegraf.d/default_outputs.conf or /etc/telegraf/telegraf.conf?

@danielnelson
Copy link
Contributor

/etc/telegraf/telegraf.conf is the default config, the other one must be something custom to your site. Don't forget that all files in /etc/telegraf/telegraf.d are loaded by default.

@danielnelson
Copy link
Contributor

Closing as I don't think there is any action to take.

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

No branches or pull requests

2 participants