index=sampleidx
|stats count(eval(value="1")) as total1
How to do this using eval?
Try this:
index=sampleidx
|eventstats count(eval(value="1")) as total1 count(eval(value="2")) as total2|eval total = total1/total2
|stats avg(total) as average by sample
Try this:
index=sampleidx
|eventstats count(eval(value="1")) as total1 count(eval(value="2")) as total2|eval total = total1/total2
|stats avg(total) as average by sample
Thats it thanks 🙂
Try this:
index=sampleidx value="1"|stats count as total1
no I cant use that, because I want to get the total count of a specific field value and then get the average for example
|eval totalcount1= (total of value="1")
|eval totalcount2 = (total of value="2")
|eval total = totalcount1/totalcount2
|stats avg(total) as average by sample
why you want to use eval instead of stats ....as stats is better to use