Reporting

How do I get a report running with cumulative stats?

pbdiggins
Explorer

 

I run a stats command every hour to show a list of firewall rules that are getting hit in a particular way. My command works for the hourly run, but I can't get a report to keep a running total of my firewall rule hit count. I've tried the following, but it's not working. Can anyone help here?

index=rsyslog firewall-ABC [search index=rsyslog (IONET_allow_BLAH_in OR IONet_allow_BLAH_outbound) host=firewall_XYZ.nascom.nasa.gov | table source_address, destination_address, destination_port] NOT (policy_id=1 OR policy_id=2)| sistats count by policy_id, source_address, destination_address | summaryindex spool=t uselb=t addtime=t index="summary" file="RMD5eef7b35350423340_1029407874.stash_new" name="Delegation_Fails" marker=""

 

Thanks,

 

Paul

 

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

You have an hourly report that writes data to a summary index.  To get a roll-up, run a separate report that reads from the summary index.

I may have given you a command that is too specific.  Try this

index="summary" search_name=<<your hourly report name>>
| stats count by policy_id, source_address, destination_address
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

That query will produce hourly stats and write them to a summary index.  To get cumulative stats, read from the summary index.

index="summary" file="RMD5eef7b35350423340_1029407874.stash_new" name="Delegation_Fails" marker=""
| stats count by policy_id, source_address, destination_address 

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

pbdiggins
Explorer

Thanks for your reply, but I don't quite understand.

I'm running this as a report hourly,  how would I use this to accomplish my goals? I don't understand the change in the index...  When I try to run the command as you posted, I get no results within the default time window. I expand the time window to "all time" and still nothing.

Sorry. I'm new to this.. Thanks.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You have an hourly report that writes data to a summary index.  To get a roll-up, run a separate report that reads from the summary index.

I may have given you a command that is too specific.  Try this

index="summary" search_name=<<your hourly report name>>
| stats count by policy_id, source_address, destination_address
---
If this reply helps you, Karma would be appreciated.
0 Karma

pbdiggins
Explorer

Thank you very much... That was the ticket!!

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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