nmitra
December 6, 2024, 2:02pm
1
Hi,
I have created a csv file as below
----------------------------------------------
Profile,Slice,ID
sss,sdf,1001
adf,ads,2001
I have selected “Query Type” as “Infinity”
Type as CSV
And Parser as UQL.
I am running the below UQL query:
parse-csv --delimiter ‘,’ --ignoreError true
| where {“Profile” == ‘sss’||“Slice” == ‘sdf’}
| project “ID”
Expected return value is “1001” , but it does not return any value .
Any idea , what could be the reason ? How to specify the OR condition on multiple columns in parse-csv command ?
With a single column selection using the where clause I am able to get the data.
I need to make the parse-csv command working for multiple column OR condition . How to achieve that ?
Any suggestions.
Thanks,
Nilanjan
I don’t think this is possible using UQL - I haven’t seen that mentioned in the documentation.
But as a workaround you can filter with Backend parser where conditions are supported and hide columns that you don’t want to show using Overrides :
nmitra
December 9, 2024, 6:51am
4
Hi ,
Thanks for your response.
I am new to Grafana …still exploring.
My requirement is to store the ID value in one variable when Profile == ‘sss’ || Slice == ‘sdf’ …and use that variable internally in another query.
So, how to store it at the variable level …any pointers.
Thanks,
Nilanjan
nmitra:
any pointers
try to solve it on datasource level, not in Grafana…
Is it neccessary to use UQL?
Such config worked for me (I changed the slice expression to ensure it would perform OR operation (and it does) but it also limits to one entry when your settings are applied).
It produces the ID value.
1 Like