Splunk Search

how to merge two sourcetype for coverage dashboard ( one gets count increase and other will have decrease in count )

dtccsundar
Path Finder

I am using below query,


index=A sourcetype IN (Compare,Fire)| fillnull value="" | search Name="*SWZWZQ0001*" OR Name="*SADAPP0002*" OR Name="*SALINU0016*" OR Name="*SGGRNP1002*" | stats values(*) as * by sysid |eval Status=if(F_Agent_Version ="" AND C_Agent_Version ="","Not Covered","Covered") | table sourcetype sysid Name F_Agent_Version C_Agent_Version Status

 

sourcetypeITAM_sysidITAM NameFire Agent VersionCompare Agent VersionStatus

Compare     

Fire

0003fbSALINU0016
32.30.
6.3Not Covered
Compare                    Fire003fcbSGGRNP1002
29.7
 Not Covered
Fire0d456SADAPP000232.3 Covered
Compare0d526SWZWZQ0001  Not Covered

 Due to the null's in the first and second rows (SALINU0016,SGGRNP1002) for Agent_version and Compare Agent Version , i am getting not covered instead of covered.Please let me know ,how to get rid of nulls and make the status Covered .

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try with the fillnull after the stats

index=A sourcetype IN (Compare,Fire)
| search Name="*SWZWZQ0001*" OR Name="*SADAPP0002*" OR Name="*SALINU0016*" OR Name="*SGGRNP1002*" 
| stats values(*) as * by sysid 
| fillnull value="" 
| eval Status=if(F_Agent_Version ="" AND C_Agent_Version ="","Not Covered","Covered") 
| table sourcetype sysid Name F_Agent_Version C_Agent_Version Status

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try with the fillnull after the stats

index=A sourcetype IN (Compare,Fire)
| search Name="*SWZWZQ0001*" OR Name="*SADAPP0002*" OR Name="*SALINU0016*" OR Name="*SGGRNP1002*" 
| stats values(*) as * by sysid 
| fillnull value="" 
| eval Status=if(F_Agent_Version ="" AND C_Agent_Version ="","Not Covered","Covered") 
| table sourcetype sysid Name F_Agent_Version C_Agent_Version Status

dtccsundar
Path Finder

This worked Perfectly . Thank You !!

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...