Splunk Search

How to use Source via Python SDK

harshal_chakran
Builder

Hi,

I am using python scripting to connect with splunk and my python script automatically uploads new files added in a folder with same index. Now when i have to search for all files under same index, it's easy as "search index="testindex"
but if i want to only search within a specific file of same index i have to use search index="testindex" source=d:\\splunk\\file.csv.

Now when i am trying to implement this using python sdk, python automatically converts "\\"in to "\" and thus splunk does not give any result. Please help me what changes need to be done to fix this issue.

How can i add extra "\" in path of source or else how can the search query be parsed without extra "\" in source path.

0 Karma
1 Solution

Damien_Dallimor
Ultra Champion
source=d:\\\\splunk\\\\file.csv

View solution in original post

Damien_Dallimor
Ultra Champion
source=d:\\\\splunk\\\\file.csv
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 ...