I have a CSV file similar to the one below:
timestamp, fullcommand, testname, details
time1, c1, test1, details1
time2, c2, test1, details2
time3, c3, test1, details3
time4, c1, test2, details4
time5, c3, test2, details5
time6, c1, test3, details6
time7, c2, test3, details7
time8, c3, test3, details8
time9, c4, test3, details9
time10, c5, test4, details10
...
I'm trying to extract (and count) all tests that contain c2 and create a pie chart that should have 2 values: count of distinct tests that contain c2 and all other tests that don't contain c2 command in any of their csv entries.
I'm using a search like the one below:
source="output.csv" | eval bool=if(match(fullcommand,".*c2.*"),"Command2 Tests", "Other tests") | chart dc(testname) as Tests by bool
This seems to be getting me the correct c2 tests distinct count, but when counting all other tests I get the total amount of tests. I suspect this is because the tests that are matched by my if condition, also have entries that do not match my condition and therefore are counted also as tests that don't contain c2.
Do you have any suggestion as to how I should build my search in order to get the desired result? Is it possible? or do I have to change the CSV structure somehow?
... View more