Splunk Search

how to avoid join

vikashperiwal
Path Finder

Hi, 

I have scenario where index and sourcetype are same and i am tryng below conditions.

chart dc(run) OVER app by event---- this will give me dc of run for each app for each event

stats dc(run) as run by app-- this will give me dc of run by app........

i used join to get this done ike below, but this is taking lot time to run query,

base search...
|chart dc(run) OVER app by event
| join app
        [search source =mysource | stats dc(run) as run by app ] 
|eval new_val = run - event1- event2 
| fields app event1 event2 new_val new run

 

 

Labels (1)
0 Karma

thambisetty
SplunkTrust
SplunkTrust

You can use append command to avoid join.

like the way you did join based on field app.

you can achieve same from append command.

example search is as below:

| search1 | stats count as count1 by app run

| append [search2 | stats count by app run1]
| stats values(*) as * by app

| do what ever you want

————————————
If this helps, give a like below.

vikashperiwal
Path Finder

The below sol would not filter by event and 2 nd app/join both are taking lot of time to run, do we see any alternative of this, 

0 Karma

thambisetty
SplunkTrust
SplunkTrust

do not append all your raw events. you should append processed results from second search. this way you can improve the performance of search.

————————————
If this helps, give a like below.
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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

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