Quantcast
Channel: InfluxDB - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 199

Epoch & Unix Timestamp Conversion

$
0
0

Hi Team,

I have “x509_cert” data from Telegraf to InfluxDB. Below is my query which I am using in dashboard.

from(bucket: "monitoring_metrics")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "x509_cert")
  |> filter(fn: (r) => r["_field"] == "enddate" or r["_field"] == "startdate" or r["_field"] == "expiry" or r["_field"] == "age")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> sort(columns: ["_time"], desc: true)
  |> last(column: "_time")
  |> group()

Screenshot 2024-10-16 at 9.46.02 am

The fields from above query “startdate”, “enddate”, “expiry” are all UnixTimestamp. I would like to show them in the human readable date format.

Can someone please provide an insight on how to handle this ?

Regards,
Pradeep

9 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 199

Trending Articles