Dashboards & Visualizations

How to bring all similar values rows in a single row after using stats

dtccsundar
Path Finder

Hi,

My requirement is like brining all the rows which are similar which has different numerical values in it ,

EX :

Search|stats sum(CountOf_xxx) as "count" sum(CountOf_yyy) as True sum(CountOf_zzz) as False by Platform Environment Tested Rule Severity |sort Tested "Rule"

Using this i am getting repeated rows aligned with same values in column.I tried of using values(Platform) as Platform values(Environment) as Environment. But still i am not getting values in single rows with sum(xxx) Sum(yyy) sum(zzz) all aligned in single rows.

Can anyone help me with answer pls.

 

 

 

Labels (1)
Tags (1)
0 Karma

aasabatini
Motivator

Hi,

it's not really clear, if you can share your search could be useful.

 

I try to reply you and sorry if I don't understand your point, try to use after the stats the comand by, and you can remove sort because the stats comand with the by at the end can sort the data for you.

“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”
0 Karma

dtccsundar
Path Finder

i need to merge the values with similar values ad the related count in one row as we get out put in SQL query.We use Sql view as input to the index here.

Percentage is calculated like (true/machines tested*100,2).

My search :

|eval Percent=round(sum(CountOf_true)/sum(CountOf_MaAchinesTested)*100,2)|eval "Percent of True Machines Tested"=case(Percent==0,0.00,1=1,Percent)|stats sum(CountOf_MachinesTested) as "Machines Tested" sum(CountOf_True) as True sum(CountOf_False_AssetsTested) as "False by Platform Environment "Tested"  Rule Severity "Percent of True Machines Tested"|sort Tested Rule 

I hope this will help you ..

 

 

 

 

Platform

Environment

Tested

Rule

 Severity

Percent of true

machines Tested

true

false

mns

DEV

ALB Security Baseline

3.2.1 ALB's should not be public

High

100.00

43

43

0

mns

LAB

ALB Security Baseline

3.2.1 ALB's should not be public

High

100.00

1

1

0

mns

PROD

ALB Security Baseline

3.2.1 ALB's should not be public

High

100.00

10

10

0

mns

PROD

ALB Security Baseline

3.2.1 ALB's should not be public

High

60.00

15

9

6

mns

PROD

 ALB Security Baseline

3.2.1 ALB's should not be public

High

90.91

22

20

2

mns

PSE

ALB Security Baseline

3.2.1 ALB's should not be public

High

100.00

4

4

0

mns

PSE

ALB Security Baseline

3.2.1 ALB's should not be public

High

83.33

6

5

1

mns

PSE

ALB Security Baseline

3.2.1 ALB's should not be public

High

90.91

11

10

1

0 Karma

aasabatini
Motivator

Try this

(unfortunately I don't know the tested field name)

 

|eval Percent=round(sum(CountOf_true)/sum(CountOf_MaAchinesTested)*100,2)|eval "Percent of True Machines Tested"=case(Percent==0,0.00,1=1,Percent)
|stats sum(CountOf_MachinesTested) as "Machines Tested" sum(CountOf_True) as True sum(CountOf_False_AssetsTested) as "False by Platform Environment "Tested" Rule Severity "Percent of True Machines Tested"
by Platform,Environment,Severity,"Tested Rule"
| table Platform Enviroment Severity "Tested Rule" "machines tested" "Percent of True Machines Tested" True False

“The answer is out there, Neo, and it’s looking for you, and it will find you if you want it to.”
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...