Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Count the number of string occurences in columns

$
0
0
I want to add two columns to a table which add up the number of times the word "TRUE" and "FALSE" occur in a row (which means, per host). Example: Host | HasA | HasB | HasC | HasD |NumTRUE|NumFALSE| Server1 | TRUE | TRUE | TRUE | TRUE | 4 | 0 | Server2 |FALSE | TRUE | TRUE | TRUE | 3 | 1 | Server3 | TRUE |FALSE | TRUE | TRUE | 3 | 1 | Server4 | TRUE |FALSE | TRUE |FALSE | 2 | 2 | Server5 |FALSE |FALSE |FALSE | TRUE | 3 | 1 | I tried something like | eventstats sum(eval(if(Has*="TRUE"),1,0)) AS NumTRUE count(eval(if(Has*="FALSE"),1,0)) AS NumFALSE but that didn't work out.

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>