influxdb1.8.9+ telegraf aggregation query

33 Views Asked by At

Hi I have the following configuration on telegraf

[[inputs.tail]]
  files = ["/etc/telegraf/LOG/sms_logfile_ERROR.log"]
  from_beginning = true
  pipe = false
  watch_method = "inotify"
  data_format = "csv"
  csv_delimiter = "|"
  csv_column_names = ["level","requestid","messaggio","eccezione","tempo","mio"]
  csv_header_row_count = ""
  csv_skip_rows = 0
  csv_timestamp_column = "tempo"
  name_override = "log_error_sms_AML"
  csv_timestamp_format = "2006-01-02T15:04:05.999999999-07:00"

the influxdb table is:

SHOW FIELD KEYS FROM "log_error_sms_AML"
name: log_error_sms_AML
fieldKey  fieldType
--------  ---------
eccezione string
level     string
messaggio string
mio       string
requestid string

why when I run this query I don't get the results of the "message" column are not aggregated, and I don't get the text? (in the message column I have different colors, so I would like a result like 35 red, 23 yellow, 4 orange etc etc).

> SELECT COUNT("messaggio") AS "conteggio" FROM "log_error_sms_AML" GROUP BY time(30m), "messaggio"
name: log_error_sms_AML
tags: messaggio=
time                conteggio
----                ---------
1695816000000000000 31
1695817800000000000 0
1695819600000000000 0
1695821400000000000 0
1695823200000000000 0
1695825000000000000 0
1695826800000000000 0
1695828600000000000 0
1695830400000000000 0
1695832200000000000 0
1695834000000000000 0
1695835800000000000 84
1695837600000000000 0
1695839400000000000 0
1695841200000000000 0
1695843000000000000 0
1695844800000000000 0
1695846600000000000 0
1695848400000000000 0
1695850200000000000 0
1695852000000000000 0
1695853800000000000 0
1695855600000000000 0
1695857400000000000 0
1695859200000000000 0
1695861000000000000 0
1695862800000000000 0
1695864600000000000 0
1695866400000000000 0
1695868200000000000 0
1695870000000000000 0
1695871800000000000 0
1695873600000000000 0
1695875400000000000 0
1695877200000000000 0
1695879000000000000 0
1695880800000000000 0
1695882600000000000 0
1695884400000000000 0
1695886200000000000 0
1695888000000000000 0
1695889800000000000 0
1695891600000000000 0
1695893400000000000 0
1695895200000000000 0
1695897000000000000 0

I also tried to change the column type from string to tag, but I can't do that either and I don't know if that's the cause:

[[processors.converter]]
  [processors.converter.tags]
    tag = ["messaggio"]
0

There are 0 best solutions below