Splunk Search

Splunk search looping ? (ver 5.0.3)

yuwtennis
Communicator

Hi all!

I would like to ask question regarding to search.

I have a search including couple of joins.

index=A *1
| join xxxx [ index=B ] *2
| join xxxx [ index=C ] *3
| join xxxx [ index=D ] *4

each index has more than 20 million records.

According to the search.log,
when I execute the search once it processes
as *2->*3->*4->*1

it went back to *2 and then processes same flow.
I have confirmed this in search.log in dispatch directory.

I found a line in the log that says,

Stats Processor - reached limit max_mem_usage_mb=200 , results may be incomplete

but couldn't confirm if this is related.

Is this a natural operation for splunk?

I appreciate if someone can give me advice.

Thanks,
Yu

Tags (1)
0 Karma

yuwtennis
Communicator

I have amended the explanation I appreciate if people can re-read it again.

0 Karma

sideview
SplunkTrust
SplunkTrust

the join command should be only a last resort, and in this case it will definitely truncate the rows of one or more of your searches here. You can read about the limitations of join here: http://answers.splunk.com/answers/822/simulating-a-sql-join-in-splunk

The good news is that there are much better, more efficient and more splunk-like ways to do the same thing, generally.

Check out this page, and the flow chart therein.

http://docs.splunk.com/Documentation/Splunk/6.1.1/Search/Abouteventcorrelation

And the best and most common of the ways to do your "join" here without join, is this way:

index=A OR index=B OR index=C OR index=D | stats count sum(foo) last(aField) as aField values(bField) as bField by xxxx

As for what's in between the stats and the by xxxx, you obviously have to think about that stuff.

These docs can tell you all about the options in the stats command:

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Commonstatsfunctions

Often there will be little idiosyncratic search language bits and normalization tricks inside all your separate joined searches. You can usually redo that logic out in the single search pipeline by using Splunk's eval command, often using the case or if functions.

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions

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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...