Splunk Search

How to extract data from Splunk to get the allowed and blocked events count separately for each firewall

anshubathla
New Member

I have few firewall logs coming into the Splunk.
I need to extract the data from Splunk to get the allowed and blocked events count separately for each firewall.
Could you please help me with the search for this?

for example
**Firewall Allowed_count Blocked_count
A 98312 4565
B 123
221
C 72333 76876**

0 Karma

woodcock
Esteemed Legend

Like this:

| tstats count FROM datamodel=Network_Traffic.All_Traffic WHERE index=* BY All_Traffic.action
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@anshubathla

If there is a field Firewall and status with Allowed OR Blocked status then below search will work for you.

YOUR_SEARCH 
| stats count(eval(status="Allowed")) as Allowed_count count(eval(status="Blocked")) as Blocked_count by Firewall

Sample Search:

| makeresults count=10 
| eval Firewall="A",status="Allowed" 
| append 
    [| makeresults count=6 
    | eval Firewall="B",status="Blocked"] 

| stats count(eval(status="Allowed")) as Allowed_count count(eval(status="Blocked")) as Blocked_count by Firewall

Thanks

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...