Splunk Search

how do I add an upper row with count eval?

3DGjos
Communicator

Hello, i'm doing a report (splunk 7.3) in which I need to append some counts in the first row of the table im generating.

this is my query:

myquery | dedup ID| eval DLP_installed=if(match(myDLPTAG, "yes", "no"), DLP_rules_installed=if(match(myDLPrules, "yes", "no") |  stats values(DLP_installed) as dlpinstalled values(DLP_rules_installed) as "rules_installed" values(Tags) AS Tags by ID, FQDN

I need to append a row containing count(eval(DLP_installed=="yes")) as first row.

any ideas?

Thanks

0 Karma

adonio
Ultra Champion

do you mean something like below?

.... | eventstats count(eval(DLP_installed=="yes")) as instlled_count ... then use the new field as you see fit

3DGjos
Communicator

Thanks for your answer!
but, with eventstats only the count fields appear as columns repeating the same information for every row.

I need them to appear as the upper row

0 Karma

adonio
Ultra Champion

yes ... just finish it off with your ... | stats ....

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...