26 Jun 2024 03:03 PM
So I have multiple metrics from SQL data source extn and I need to put them in rows and show the value. I am doing it like below.
But this is pulling data in one single row, instead of two rows. Can you please suggest how to get the intended result. any suggestion is appreciated. Thank you.
timeseries { db_invalid_object = avg(db_invalid_object)} , by: {device}, filter: { device == "a" }
|fieldsAdd HealthType ="DB Invalid Object"
|fieldsAdd db_invalid_object_count = arrayAvg(db_invalid_object)
|fieldsadd current_status = if(db_invalid_object_count==0.00, "HEALTHY", else: "UNHEALTHY")
|fieldsAdd db_node= device
|fields HealthType,db_node, current_status,db_invalid_object_count
|join [timeseries { db_invalid_index = avg(db_invalid_index)} , by: {device}, filter: { device == "a" }
|fieldsAdd HealthType ="DB Invalid Index"
|fieldsAdd db_invalid_index_count = arrayAvg(db_invalid_index)
|fieldsadd current_status = if(db_invalid_index_count==0.00, "HEALTHY", else: "UNHEALTHY")
|fieldsAdd db_node= device
|fields HealthType,db_node, current_status,db_invalid_index_count]
,on:{db_node}
Solved! Go to Solution.
27 Jun 2024 04:55 PM
Please use append command:
timeseries { db_invalid_object = avg(db_invalid_object)} , by: {device}, filter: { device == "a" }
| fieldsAdd HealthType ="DB Invalid Object"
| fieldsAdd db_invalid_object_count = arrayAvg(db_invalid_object)
| fieldsadd current_status = if(db_invalid_object_count==0.00, "HEALTHY", else: "UNHEALTHY")
| fieldsAdd db_node= device
| fields HealthType,db_node, current_status,db_invalid_object_count
| append [
timeseries { db_invalid_index = avg(db_invalid_index)} , by: {device}, filter: { device == "a" }
| fieldsAdd HealthType ="DB Invalid Index"
| fieldsAdd db_invalid_index_count = arrayAvg(db_invalid_index)
| fieldsadd current_status = if(db_invalid_index_count==0.00, "HEALTHY", else: "UNHEALTHY")
| fieldsAdd db_node= device
| fields HealthType,db_node, current_status,db_invalid_index_count
]
Kris
28 Jun 2024 05:19 PM
Thanks @krzysztof_hoja . It worked as expected. Is there anyway to import the DQL dashboard to Dashboard classic page ?