Splunk Search

How to combine a lookup table with a search with multiple entries?

jturner900
Explorer

I'm trying to combine a lookup table:

Team  , Player 
A          , Malone
            , Stockton
B          , Jordan 
             ,Pippen

with a search:

Player,Mascots
Malone ,Jazz
                      ,Kings
                      ,Warriors
Stockton       ,Jazz
                      ,Lakers
Jordan           ,Bulls
                      , Heat
Pippen          , Bulls

I'd like the result to look like

Team ,  Player      ,     Mascot
A      ,     Malone     ,   Jazz
                            ,    ,   Kings
                            ,     ,  Warriors
A   ,      Stockton    ,  Jazz
                          ,       , Lakers
B      ,     Jordan     ,      Bulls
                         ,          ,  Heat
B       ,    Pippen         ,  Bulls

I normally use the following search: |inputlookup teamtable |join player [search index=playertable| table player], but it says 'No results found'. I think is has something to do with the fact that there are multiple row entries. Please help!!!

0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try (check field names, as they are case sensitive)

 |inputlookup teamtable | mvexpand player |join player [search index=playertable| table player]

If you've control over how the teamtable lookup is written, write it with single values of the players and teams, so that you could this much efficient version.

index=playertable| table player | lookup teamtable player

View solution in original post

somesoni2
Revered Legend

Give this a try (check field names, as they are case sensitive)

 |inputlookup teamtable | mvexpand player |join player [search index=playertable| table player]

If you've control over how the teamtable lookup is written, write it with single values of the players and teams, so that you could this much efficient version.

index=playertable| table player | lookup teamtable player
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...