Splunk Search

Match a column from a main query with a column in a subquery

ravikumar_sri20
Engager

Hi Experts,

The file ACF2DS_Data.csv contains columns including TIMESTAMP, DS_NAME, and JOBNAME.

I need to match the DS_NAME column from this file with the LKUP_DSN column in DSN_LKUP.csv to obtain the corresponding events from ACF2DS_Data.csv.

The query provided below is not working as expected.

Could you please assist me in resolving the issue with the query?

source="*ACF2DS_Data.csv" index="idxmainframe" earliest=0 latest=now
[search source="*DSN_LKUP.csv" index="idxmainframe" earliest=0 latest=now
| eval LKUP_DSN = "%".LKUP_DSN."%"
| where like(DS_NAME,LKUP_DSN) | table DS_NAME]
| table TIMESTAMP, DS_NAME, JOBNAME

Thanks,
Ravikumar

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you need to match the LKUP_DSN field in the subsearch with the DS_NAME field in the main search then LKUP_DSN must renamed to DS_NAME.

source="*ACF2DS_Data.csv" index="idxmainframe" earliest=0 latest=now
[search source="*DSN_LKUP.csv" index="idxmainframe" earliest=0 latest=now
  | rename LKUP_NAME as DS_NAME
  | fields DS_NAME
  | format ]
| table TIMESTAMP, DS_NAME, JOBNAME
---
If this reply helps you, Karma would be appreciated.
0 Karma

ravikumar_sri20
Engager

Hi,

Thanks for your reply!!..I need to do partial match on LKUP_DSN.  Could you please help ?

Thanks,

Ravikumar

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Tell us more about the partial match on LKUP_DSN.  What is it matched against?  What part needs to match?

---
If this reply helps you, Karma would be appreciated.
0 Karma

ravikumar_sri20
Engager

The file ACF2DS_Data.csv comprises columns such as TIMESTAMP, DS_NAME, and JOBNAME.

I need to perform a partial match of the LKUP_DSN column from the DSN_LKUP.csv file with the DS_NAME column in the ACF2DS_Data.csv file in order to retrieve the relevant events from ACF2DS_Data.csv.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What constitutes a match between LKUP_DSN and DS_NAME?  How much of DS_NAME is allowed to vary?

---
If this reply helps you, Karma would be appreciated.
0 Karma

ravikumar_sri20
Engager

At times, LKUP_DSN will match exactly with DS_NAME. In other instances, LKUP_DSN will contain all the characters of DS_NAME except for the last nine characters.

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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