I want to dynamically remove a number of columns/headers from my stats.
So my thinking is to use a wild card on the left of the comparison operator.
But this does not work
... | where "P-CSCF*">4
Sample Output: Say for example I just wanted to remove the columns P-CSCF-02 & P-CSCF-06
and have P-CSCF-05 and P-CSCF-07
showing. I would like to do it with something like ... | where "P-CSCF*">1
for example. I could use fields +
option but that is static I want something dynamic.
_time P-CSCF-02 P-CSCF-05 P-CSCF-06 P-CSCF-07
2017-11-27T18:30:00.000+1300 1 2 0 6
2017-11-27T18:35:00.000+1300 0 2 0 6
2017-11-27T18:40:00.000+1300 0 2 0 6
EDIT1
This is my Desired Output with only 2 columns showing, the others omitted because they do not have any values > 1:
_time P-CSCF-05 P-CSCF-07
2017-11-27T18:30:00.000+1300 2 6
2017-11-27T18:35:00.000+1300 2 6
2017-11-27T18:40:00.000+1300 2 6
Should I be using something like ... | WHERE like(source,"/logs/%/camel-audit.log")]
Not what I want but this is wildcarding on the RHS of the comparison operator ...|search version=*10_2*
You could try append the following to your time chart table:
| untable _time field count
| eventstats avg(count) as field_avg by field
| where field_avg > 1
| xyseries _time field count
That would remove all the field with an average lesser than 1. You can adjust depending on how you want to filter (use max, sum, min, etc.. instead of avg for example)
If you explain in more details when you want to remove a column, I could give you a more complete answer.
Ahh, yes. I definitely misunderstood the request, sorry!
That's a very clean solution. I'm saving that in my book of tricks.
How are you making it dymanic? A token?
What's your current full search?