Splunk Search

Help needed with inner join with different field name and a filter

harryhcg
Explorer

Can someone help with query?


I have 2 index abc and bcz
From abc index I want to show stats for field1
where field2 from index abc matches with field3 of index bcz
and bcz index field5="value"

 

what I tried which is not working: 

index=abc

| stats count by field1

| join type=inner field2

[search index=bcz 
| rename field3 as field2

| where field5="employee_name"]

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=abc [search index=bcz 
  | where field5="employee_name"
  | rename field3 as field2
  | fields field2]
| stats count by field1

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=abc [search index=bcz 
  | where field5="employee_name"
  | rename field3 as field2
  | fields field2]
| stats count by field1
0 Karma

harryhcg
Explorer

@ITWhisperer  You are awesome, I was so stupid.
Thank you.

0 Karma
Get Updates on the Splunk Community!

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Get Inspired! We’ve Got Validation that Your Hard Work is Paying Off

We love our Splunk Community and want you to feel inspired by all your hard work! Eric Fusilero, our VP of ...

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...