Getting Data In

Using an outer join with an inputlookup file

jsmith39
Path Finder

I'm trying to match the dates on specific event logs with an inputlookup file. I've done this in the past and it has worked perfectly but for some reason, in this case the data is not coming back as expected and I'm hoping someone can shine a light on the issue.

My inputlookup csv file is just one column with a list of county names in it. My query is looking through event logs to find a specific event, then parse the date down to a specific format and return that result next to the county name. The interesting field is db_name which corresponds exactly to the county name field.

So my expected results are
County DB Backup
Albany Thursday, July, 10th, 2014
Broome Thursday, July, 10th, 2014
....

What is happening instead is I'm getting the above results but instead of db_name Albany being matched up to County Albany, the query has grabbed one database record and populated the entire list with it.

| inputlookup counties.csv | join type=outer [search host=main_server EventCode=17055 | sort -_time | dedup db_name | eval "DB Backups"=strftime(_time, "%A, %b %d, %Y")] | table County "DB Backups"

Tags (2)

somesoni2
SplunkTrust
SplunkTrust

I see the join field name is not specified and that could be the reason for that behaviour.
Try this

| inputlookup counties.csv | join type=left County [search host=main_server EventCode=17055 | sort -_time | dedup db_name | eval "DB Backups"=strftime(_time, "%A, %b %d, %Y")] | table County "DB Backups"

Updated

Try this

host=main_server EventCode=17055 | sort -_time | dedup db_name | eval "DB Backups"=strftime(_time, "%A, %b %d, %Y") | table County "DB Backups" | append [ | inputlookup counties.csv ] | stats values("DB Backups") as "DB Backups" by County
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try the updated answer (mimicing full outer join)

0 Karma

jsmith39
Path Finder

Thank you for replying, unfortunately that didn't work. It did keep Splunk from returning the same record repeatedly, but it ended up not returning any data other than the County list that is part of the .csv file.

I removed the | table ... to see what all was being returned but all of the fields except for county were empty,

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...