Splunk Search

Compare entire lookup table to another

splunk219783
Path Finder

I thought this would be easy but i'm struggling.  I have a CSV of firewall rules from yesterday, and a CSV of Firewall rules from today.  They're being ingested into splunk but i figured the easiest way to compare the two would be to make them lookup tables.  But I can't figure how to compare ALL values?  This is to audit for any changes.   The Data is kind of like this:

Yesterdays Rules:

NameActionSrcIpDestIpPort
WebServerAllow192.168.1.2192.168.0.380
ApplicationDeny192.168.1.10192.168.0.111020
OutboundAllow192.168.0.0/24*80

 

Todays Rules

NameActionSrcIpDestIpPort 
WebServerAllow192.168.1.2192.168.0.3,192.168.0.480 
ApplicationDeny192.168.1.10192.168.0.111020 
OutboundAllow192.168.0.0/24*80 

 

In the example the Webserver can now access an additional server.  But in reality any value could change and I need to alert on it. I basically just want to do a diff.  A little surprised its difficult to do in splunk.

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @splunk219783,

you have to use stats, please try something like this:

| inputlookup yesterday_rules.csv
| eval lookup_name="yesterday_rules.csv"
| append [ | | inputlookup today_rules.csv | eval lookup_name="today_rules.csv" ]
| stats 
   dc(lookup_name) AS lookup_name_count 
   values(lookup_name) AS lookup_name
   BY Name Action SrcIp DestIp Port
| where lookup_name_count=1
| table Name Action SrcIp DestIp Port lookup_name

in this way you have all the differences.

Ciao.

Giuseppe

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...