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 Timestamp format (ts-epochmilli) #6699

Closed
fedeori opened this issue Nov 21, 2019 · 1 comment
Closed

Telegraf Timestamp format (ts-epochmilli) #6699

fedeori opened this issue Nov 21, 2019 · 1 comment
Labels
bug unexpected problem or unintended behavior

Comments

@fedeori
Copy link

fedeori commented Nov 21, 2019

When parsing a CSV file (obtained from Jmeter) with telegraf logparser, the first field is an epoch timestamp in milliseconds, and when i try to set it as ts-epochmilli, telegraf can't parse it to that format.
When i try to use just the ts option (any timestamp) telegraf can not find any suitable time layout.

Relevant telegraf.conf:

files = ["/path/to/input.log"]
from_beginning = true
name_override = "metric_name"
watch_method = "poll"

[inputs.logparser.grok]
patterns = ["%{CUSTOM_JMETER}"]
custom_patterns = '''
CUSTOM_JMETER %{POSINT:timestamp:ts-epochmilli},%{INT:elapsed:int},("%{DATA:label}"|%{DATA:label}),%{WORD:responseCode:string},("%{DATA:responseMsg}"|%{DATA:responseMsg}),("%{DATA:threadName}"|%{DATA:threadName}),("%{DATA:datatype}"|%{DATA:datatype}),%{WORD:success},("%{DATA:failureMessage}"|%{DATA:failureMessage}),%{INT:bytes:int},%{INT:sentBytes:int},%{INT:grpThreads:int},%{INT:allThreads:int},("%{DATA:url}"|%{DATA:url}),%{INT:Latency:int},%{INT:IdleTime:int},%{INT:Connect:int}
'''

System info:

Tested in telegraf-1.12.6 in windows an linux (CentOs).

Steps to reproduce:

Configure telegraf as shown above, using the attached file as input (it is a standard jmeter csv output). Configure output to influxdb.

Expected behavior:

Import the data using the first field as timestamp.

Actual behavior:

There's an error parsing timestamp to ts-epochmilli .
2019-11-21T23:26:06Z E! Error parsing 1574293698744 to time layout [ts-epochmilli]: parsing time "1574293698744" as "ts-epochmilli": cannot parse "1574293698744" as "ts-epochmilli"
2019-11-21T23:26:06Z E! Error parsing 1574293698745 to time layout [ts-epochmilli]: parsing time "1574293698745" as "ts-epochmilli": cannot parse "1574293698745" as "ts-epochmilli"
2019-11-21T23:26:06Z E! Error parsing 1574293699931 to time layout [ts-epochmilli]: parsing time "1574293699931" as "ts-epochmilli": cannot parse "1574293699931" as "ts-epochmilli"

With ts format
2019-11-21T23:46:20Z E! Error parsing timestamp [1574293698744], could not find any suitable time layouts.
2019-11-21T23:46:20Z E! Error parsing timestamp [1574293698745], could not find any suitable time layouts.
2019-11-21T23:46:20Z E! Error parsing timestamp [1574293699931], could not find any suitable time layouts.
2019-11-21T23:46:20Z E! Error parsing timestamp [1574293699931], could not find any suitable time layouts.
2019-11-21T23:46:20Z E! Error parsing timestamp [1574293700992], could not find any suitable time layouts.
2019-11-21T23:46:20Z E! Error parsing timestamp [1574293701003], could not find any suitable time layouts.
If i try with ts telegraf cant find the wright format.

Additional info:

input.log

@danielnelson danielnelson added this to the 1.12.7 milestone Nov 22, 2019
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Nov 22, 2019
@danielnelson
Copy link
Contributor

This time layout was added in #6476 and will be first released in Telegraf 1.13.0.

@danielnelson danielnelson removed this from the 1.12.7 milestone Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants