Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Custom Python Command to read a CSV file

$
0
0
I have created a custom python command but I'm facing this problem. I have a dynamic **fileName**. The filename that I want to read changes everyday. It works fine before I package the code using the splunk streaming command. **with open('C:\Users\Desktop\%s\%s\%s'%('assetfiles','DailySchedule',fileName)) as csv_file:** This will give me: C:\Users\KGQJ3999\Desktop\assetfiles\assetfiles\DailySchedule\2019-12-20_NAME1.csv However, after packaging it into the streaming command, it's giving me this. C:\Users\KGQJ3999\Desktop\assetfiles\assetfiles\DailySchedule\ .csv I have tried many ways to concatenate strings. Even forcing the filename to be str(fileName). Still, the fileName is dissappearing from the splunk side and I'm getting the IO error. Anybody has any idea why??

Viewing all articles
Browse latest Browse all 47296

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>