Hi guys, the first post for me here
I am having trouble ingesting a log using Telegraf logparse, specifically regarding the date, it is something like MM/dd/yyyy hh:mm:ss AM/PM.
I can not make it work with any of the supposed ways, any help, please? The idea is to use that date as a timestamp.
5/31/2019 11:40:26 AM 9 (5176) Root folder opened successfully
5/31/2019 11:40:26 AM 9 (5176) Exchange Web Services initialized.
5/31/2019 11:40:26 AM 9 (5176) Counting items...
5/31/2019 11:40:26 AM 9 (5176) found 7 item(s).
5/31/2019 11:40:26 AM 9 (5176) Restoring items...
5/31/2019 11:40:26 AM 9 (5176) Initializing Exchange Web Services...
Mixing both DATEUS and time on one custom pattern, etc, but nothing, have you seen this before? It is the date with I have problems, the rest is fine. I couldn’t find a way to parse the whole date on a string Telegraf will understand I’ve tried with the ts-custom but nothing.
Hello,
Thanks for replying, timestamp so I can later on combine them and show them with Grafana, by using the timestamp on the dashboard on the top right. I can get it as a string, or as a tag, but then I will lose that ability to group them by time, etc.
Plus, because not really proper timestamp, every time I restart telegraf it does duplicates all.
Hello,
Top work, thank you for that! So I am saving now the timestamp properly as string it seems, as I have the telegraf time when the metric was introduced and this timestamp. Is this correct?
How can I know use the timestamp on Grafana, or Chronograf to order by it?
2019-06-16T16:24:09Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"veeamvbo3", Flush Interval:10s
2019-06-16T16:24:09Z E! Error parsing timestamp [4/5/2019 12:22:15 PM], could not find any suitable time layouts.
2019-06-16T16:24:09Z E! Error parsing timestamp [4/8/2019 9:20:28 AM], could not find any suitable time layouts.
2019-06-16T16:24:09Z E! Error parsing timestamp [4/8/2019 9:21:43 AM], could not find any suitable time layouts.
2019-06-16T16:24:09Z E! Error parsing timestamp [4/11/2019 2:29:07 AM], could not find any suitable time layouts.
2019-06-16T16:24:09Z E! Error parsing timestamp [4/30/2019 4:52:44 AM], could not find any suitable time layouts.
2019-06-16T16:24:09Z E! Error parsing timestamp [5/1/2019 3:41:36 AM], could not find any suitable time layouts.
The :ts-"blah" suffix describes to Go how to interprete the string matched in the %{DATESTAMP_AMPM} pattern. It is a little strange to work with on first use, the way it works is that you put the reference date, defined to be “Mon Jan 2 15:04:05 MST 2006” into the format of the date in your input file.
If the timestamps are not in UTC time, you will need to use the timezone option too, since your date string does not contain zone information.