Splunk Search

Zero results when searching with Splunk Powershell Module.

cmlombardo
Path Finder

I am experiencing an odd behavior with my Splunk module for powershell. A search query that on the web interface would return plenty of results returns emptyhanded when ran in Powershell.

Not everything fails though. Some simple queries work just fine. As soon as I make it a little more complex, nothing comes back.

The Splunk backend is on version 5.0.5.

Is anybody experiencing similar issues?

Thank you,

Claudio

0 Karma

cmlombardo
Path Finder

Well, I finally figured it out.
BEWARE POWERSHELL USERS!

If your user app context is different than the "Search app", then you are in trouble.
Well, not so much trouble, as long as you have access to the "Search App" as well.

I have a bunch of Macros, Tags, Event Types and so on defined in my app.
None of them were defined in the "search app".

It turns out that when you use Powershell and you login with your user with the commandlet "connect-splunk", your app context in Powershell is the "Search app". The reason why no results were returned is because my search query was referring all these nice object I defined in my app context.

Once I figured that out, I basically cloned all the macros, tags, eventtypes, field extractions I needed into "search" and voila'! Plenty of results out of my Powershell query.

It is obviously a bug. Considering that the Powershell module was updated more than 2 years ago, I don't see a fix coming anytime soon.

I hope this helps somebody out there!

Claudio

0 Karma

vandelin
New Member

I'm having this exact issue, I dont have admin rights to be cloning stuff into the search context, that is if this is what you did to resolve this.

Is there anyway in powershell i can change my "app"

0 Karma

halr9000
Motivator

Can you give some search command examples which work and don't?

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

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