Splunk Search

Streamstats for multiple columns

mbschriek
Explorer

The following table is representing positions in uPos for different columns. Each number in a c_ column is representing the number of positions are taken, starting at the position which the number is positioned.

For example:
The item in column c_A - 7 is representing reserved cells at uPos 7, 8, and 9.
The item in column c_F - 2 is representing reserved cells at uPos 2, 3, 4, and 5.

Goal:
I would like to fill all the reserved cells with a number to represent a nice bar chart.

Does anyone has an idea to solve this?

alt text

Tags (1)
0 Karma
1 Solution

mbschriek
Explorer

Solved it myself:

 | foreach c* [eval <<FIELD>>='<<FIELD>>'+uPos-1] | makecontinuous uPos | filldown c* | foreach c* [eval <<FIELD>>=if(('<<FIELD>>'-uPos)>=0,"1","0")]

View solution in original post

0 Karma

mbschriek
Explorer

Solved it myself:

 | foreach c* [eval <<FIELD>>='<<FIELD>>'+uPos-1] | makecontinuous uPos | filldown c* | foreach c* [eval <<FIELD>>=if(('<<FIELD>>'-uPos)>=0,"1","0")]
0 Karma

woodcock
Esteemed Legend

Be sure to click Accept on your answer.

0 Karma
Get Updates on the Splunk Community!

Splunk ITSI & Correlated Network Visibility

  Now On Demand   Take Your Network Visibility to the Next Level In today’s complex IT environments, ...

Community Content Calendar, August edition

In the dynamic world of cybersecurity, staying ahead means constantly solving new puzzles and optimizing your ...

Pro Tips for First-Time .conf Attendees: Advice from SplunkTrust

Heading to your first .Conf? You’re in for an unforgettable ride — learning, networking, swag collecting, ...