Splunk Search

search within a sub-search

atenciodeyka
New Member

I have been working on a search for a table view, what I want is to be able to see the results from this search from two different time frames o the same table, the first time frame brings back the results correctly; when I use the search command to run the same search with a different time frame to display it on the table is when things don't seem to be going well. This is the search:

index="XXX" sourcetype="XXX" host=$host1$ earliest=-37d@d latest=-30d@d action="drop" OR action=blocked | top limit=20 src | append [search index="XXX" sourcetype="XXXX" host=$host1$ earliest=-7d@d latest=now action="drop" OR action=blocked | top limit=20 src ]

Tags (1)
0 Karma

atenciodeyka
New Member

Ok, the only problem is that on the table I can't see both fields (src), the one from seach 1 and the other one from serch.

0 Karma

nick405060
Motivator

you didn't table src, is that the problem?

0 Karma

Sukisen1981
Champion

if you can see _time,_raw and host all you need is to add src field to the table

0 Karma

nick405060
Motivator

What exactly is the issue you're having? You should be able to do this without a problem.

I do exactly this pretty often - the only immediate difference I notice is that you don't have quotations around $host1$. Try that.

0 Karma

Sukisen1981
Champion

Looks like you are checking the search events , can you try this and check in the statistics tab?

index="XXX" sourcetype="XXX" host=$host1$ earliest=-37d@d latest=-30d@d action="drop" OR action=blocked | top limit=20 src |table _time,host,_raw| append [search index="XXX" sourcetype="XXXX" host=$host1$ earliest=-7d@d latest=now action="drop" OR action=blocked | top limit=20 src |table _time,host,_raw]
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...