Getting Data In

Sub Searching - tstats

griggsy
New Member

Hello,

I have a query for returning blocked data from our firewall to Google's DNS Servers - I now want to correlate this with data from our proxy to attempt to identify the user logged onto the machine. What I have written is below:

| tstats summariesonly=t count as Count, dc(fw.rule) as dc_rules, values(fw.rule) as rules, max(_time) as LastSeen, values(fw.dest_ip) as Destination FROM datamodel=Firewall.fw WHERE fw.dest_ip = 8.8.4.4 OR fw.dest_ip = 8.8.8.8 AND fw.action = "blocked" BY fw.src_ip, fw.action | rename src_ip as src_host | join srch_host [ search index=proxy | fields src_host,UserName] | table src_host,Destination,action,UserName,Count

The proxy index is quite data heavy so ideally I would like to set the search to have src_host as the src_host identified in the parent query. Could anyone help a.) Streamline the query to improve performance and b.) help me get it working!

Many Thanks

Tags (1)
0 Karma

valiquet
Contributor

Drop the sub search. Use a lookup running on indexers.

Use fields instead of table.

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

  🚀 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 ...