Splunk Search

lookups via powershell resource kit

Bulluk
Path Finder

Does anyone know if it's possible to perform a lookup when using the powershell resource kit's search functionality? I'm currently on v4.2 and saw that lookup was added to the rest api in 4.3 so I'm guessing this won't be possible yet....

My really simple search is

find something | lookup myLookup name AS userName OUTPUTNEW Title AS Title

which works fine via the gui but not when using powershell

Thanks in advance

Tags (2)
0 Karma
1 Solution

Bulluk
Path Finder

Turns out that if you add the -RequiredField flag to the search it returns the values from the lookup, ie:

$results = Search-Splunk -Search "find something `| lookup myLookup name AS userName OUTPUTNEW Title AS Title" -RequiredField "Title"

View solution in original post

Bulluk
Path Finder

Turns out that if you add the -RequiredField flag to the search it returns the values from the lookup, ie:

$results = Search-Splunk -Search "find something `| lookup myLookup name AS userName OUTPUTNEW Title AS Title" -RequiredField "Title"

Bulluk
Path Finder

I hate to do this but I thought it might be worth giving this a little bump now that America is awake and at work

I promise not to make a habit of it 🙂

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