Hi @zip-chanko,
Your example data is missing timestamps for a timeseries, so I added it. The result should look something like this:
data record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:00:00.0-05:00" ),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:01:00.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:02:00.0-05:00"),
record(host = "example.com", http_status = "301", timestamp="2024-05-07T12:03:39.0-05:00"),
record(host = "example.com", http_status = "403", timestamp="2024-05-07T12:04:40.0-05:00"),
record(host = "example.com", http_status = "403", timestamp="2024-05-07T12:05:41.0-05:00"),
record(host = "example.com", http_status = "502", timestamp="2024-05-07T12:06:42.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:01:00.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:02:00.0-05:00"),
record(host = "example.com", http_status = "301", timestamp="2024-05-07T12:03:39.0-05:00"),
record(host = "example.com", http_status = "403", timestamp="2024-05-07T12:04:40.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:02:00.0-05:00"),
record(host = "example.com", http_status = "301", timestamp="2024-05-07T12:03:39.0-05:00"),
record(host = "example.com", http_status = "403", timestamp="2024-05-07T12:04:40.0-05:00"),
record(host = "example.com", http_status = "403", timestamp="2024-05-07T12:05:41.0-05:00"),
record(host = "example.com", http_status = "502", timestamp="2024-05-07T12:06:42.0-05:00"),
record(host = "example.com", http_status = "502", timestamp="2024-05-07T12:07:43.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:08:44.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:09:45.0-05:00"),
record(host = "example.com", http_status = "200", timestamp="2024-05-07T12:10:46.0-05:00")
| fieldsAdd httpstatus = toLong(http_status)
| fieldsRemove http_status
| makeTimeseries {
total=count(),
http_2xx = countIf(httpstatus == 200 and httpstatus == 201),
http_4xx = countIf(httpstatus >= 400 and httpstatus < 500),
http_5xx = countIf(httpstatus > 500)
},
by: {}