Splunk Search

subsearch not working

benzmmrmnn86
New Member

I have an alert using a subsearch that was working a few weeks ago. Now all of a sudden i cannot get any subsearchs to work. A very simple search i performed is:

index=IndexName sourcetype=WindowsEventLogs [search sourcetype="VPNLogs" CN=Ben_zimmermann
| table CN]

If i perform each search individually, i get results but when i put them together, i do not get any results.

0 Karma

gcusello
SplunkTrust
SplunkTrust

HI @benzmmrmnn86,
when you run the subsearch by itself, what's the number of results?
remember that there's the limit of 50,000 results in subsearches, so if you have more results. maybe the ones you need are the exceeding part of results.
You could modify subsearch as the following:

index=IndexName sourcetype=WindowsEventLogs [search index=my_index sourcetype="VPNLogs" CN=Ben_zimmermann
| dedup CN | table CN]

Then I agree with @oscar84x: it's a good practice to use always the index in every search and subsearch.

Ciao.
Giuseppe

0 Karma

jpolvino
Builder

Can you please run it against a time period that is known to be good? You mention a few weeks, so try a little before that when you know you had positive alerts. Maybe the composition of your logs has changed.

0 Karma

oscar84x
Contributor

Off the top of my head, could you try specifying the index in the subsearch?

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!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...