Grafana loki - time series chart - average cpu by host

Hi all,
I put below data into Loki, with job = csv_solarwinds_cpu

timestamp	                               caption	cpuload	department
2022-07-18T07:41:58.7100000	sfin001	 5	finance
2022-07-18T07:40:35.7100000	ssal005	59	sales
2022-07-18T07:42:28.7100000	slog003	30	logistic
2022-07-18T07:36:54.0000000	sfin001	10	finance
2022-07-18T07:35:14.0000000	ssal005	45	sales
2022-07-18T07:35:36.0000000	slog003	25	logistic
2022-07-18T07:30:24.0000000	sfin001	9	finance
2022-07-18T07:29:38.0000000	ssal005	55	sales
2022-07-18T07:30:36.0000000	slog003	22	logistic
2022-07-18T07:26:54.0000000	sfin001	7	finance
2022-07-18T07:25:14.0000000	ssal005	35	sales
2022-07-18T07:25:36.0000000	slog003	20	logistic

I would like to display in the time series chart the average cpluload of each server.

avg_over_time(
{job="csv_solarwinds_cpumem"} 
| unwrap cpuload
[10m]
) by (caption)

but somehow it is returning with error. I’m not sure if the LogQL syntax is correct.

pipeline error: 'SampleExtractionErr' for series: '{__error__="SampleExtractionErr", filename="/data/csv_solarwinds/csv-svr-cpumem.csv", job="csv_solarwinds_cpumem"}'. Use a label filter to intentionally skip this error. (e.g | __error__!="SampleExtractionErr"). To skip all potential errors you can match empty errors.(e.g __error__="") The label filter can also be specified after unwrap. (e.g | unwrap latency | __error__="" ) 

Please let me know the correct query. thank you

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.