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

logparser can not handle timestamp like 2018-04-11 10:04:20,859 #4013

Closed
crazy-canux opened this issue Apr 12, 2018 · 1 comment
Closed

logparser can not handle timestamp like 2018-04-11 10:04:20,859 #4013

crazy-canux opened this issue Apr 12, 2018 · 1 comment

Comments

@crazy-canux
Copy link
Contributor

Bug report

Relevant telegraf.conf:

patterns = ['''%{TIMESTAMP_ISO8601:asctime:ts-"2006-01-02 15:04:05,000"} [%{DATA:name:string}] %{LOGLEVEL_PYTHON:levelname:string}: %{GREEDYDATA:message:string}''']

custom_patterns = '''
LOGLEVEL_PYTHON (?:WARNING|ERROR|CRITICAL)
'''

System info:

telegraf-1.6.0

ubuntu14.04

Steps to reproduce:

$ sudo service telegraf restart
$ echo 2018-04-11 10:04:20,859 [lib.test] ERROR: test test test >> test.log

Expected behavior:

parse log into output plugin.

Actual behavior:

2018-04-12T06:34:46Z E! Error parsing 2018-04-11 10:04:20,859 to time layout [2006-01-02 15:04:05]: parsing time "2018-04-11 10:04:20,859": extra text: ,859

2018-04-12T06:36:48Z E! Error parsing 2018-04-11 10:04:20,859 to time layout [2006-01-02 15:04:05,000]: parsing time "2018-04-11 10:04:20,859" as "2006-01-02 15:04:05,000": cannot parse "859" as ",000"

Additional info:

[Include gist of relevant config, logs, etc.]

when I use string instead of ts, it works.
But, how to handle the ",859" in telegraf?

@danielnelson
Copy link
Contributor

We have an issue open for this #3571, unfortunately there is not a known workaround at this time.

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

No branches or pull requests

2 participants