Closed krystiancharubin closed 4 years ago
@krystiancharubin Ahh okay, the direction I was headed was using the convert functions in telegraf which didn't work of course as I now understand it to not be for this kind of "conversion".
After implementing the regex processor you came up with, without changing anything in Grafana, the Date and Time look better since it is spaced out, however changing the table column data type to "Date" results in "Invalid Date" being displayed. Leaving it on "Number" or "String" displays it as your processor outputs it, but choosing a Date and Time "Unit" doesn't chop off the extra zeros and "-300" after the SS, which I am guessing most people won't care to see since they likely know the timezone the server is in. I am guessing just removing that section from the regex string in your code will accomplish this and make Grafana show "YYYY-MM-DD HH:MM:SS", although before I do, was the idea behind your regex to leave the ".000000-300" and have Grafana turn that into a text timezone like "EST" or Grafana can't even do that?
Thank you for the contribution.
@ilovepancakes95 hmm, that regex seems to work fine for me. I figured I would include all the available data so all formatting options are available. Grafana seems to use moment.js so any format you come up with is supported. For example YYYY-MM-DD HH:mm:ss.SSSSSSZZ should format it the same way we are saving it.
What version of Grafana are you running? I am on v6.7.2 (423a25fc32).
Also try restarting influxdb, telegraf and grafana. I had saw invalid date while testing but resolved by restarting.
@krystiancharubin Definitely want to include it all too, I'm on 6.7.2 as well. Here is what I see when changing the column type, and what the date and time shows as when "String" is selected.
EDIT: No go on restarting everything too, didn't help it seems.
@krystiancharubin And I tested removing the ".${SSSSSS}${ZZ}" from replacement string again to see if it recognizes dates then, and it does.
That is strange, here is what I get when String/Date is selected, have you tried doing Empty Cache and Hard Reload to see if maybe some parts of the frontend are cached from previous version. In the meantime we can remove those and just create an issues to investigate adding fractional seconds and timezone.
@krystiancharubin Very strange. I did a full reboot of the VM my stack is running on and tried from a Private Browsing Window to avoid any cache issues, no dice. I'll merge the latest. I've never seen iDRAC use the fractional seconds amount so really only timezone is going to be missing. Thank you, nice work.
Uses telegraf regex processor to reformat date and time into something Grafana can understand. Just need to update the visualization option to date and select the desired date format.