<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom Python Command to read a CSV file in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Python-Command-to-read-a-CSV-file/m-p/471411#M8460</link>
    <description>&lt;P&gt;I have created a custom python command but I'm facing this problem. I have a dynamic &lt;STRONG&gt;fileName&lt;/STRONG&gt;. &lt;BR /&gt;The filename that I want to read changes everyday.&lt;BR /&gt;It works fine before I package the code using the splunk streaming command.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;with open('C:\Users\Desktop\%s\%s\%s'%('assetfiles','DailySchedule',fileName)) as csv_file:&lt;/STRONG&gt;&lt;BR /&gt;This will give me:&lt;BR /&gt;C:\Users\KGQJ3999\Desktop\assetfiles\assetfiles\DailySchedule\2019-12-20_NAME1.csv&lt;/P&gt;
&lt;P&gt;However, after packaging it into the streaming command, it's giving me this.&lt;BR /&gt;C:\Users\KGQJ3999\Desktop\assetfiles\assetfiles\DailySchedule\ .csv&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Anybody has any idea why??&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jun 2020 18:37:46 GMT</pubDate>
    <dc:creator>marvinlee93</dc:creator>
    <dc:date>2020-06-07T18:37:46Z</dc:date>
    <item>
      <title>Custom Python Command to read a CSV file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Python-Command-to-read-a-CSV-file/m-p/471411#M8460</link>
      <description>&lt;P&gt;I have created a custom python command but I'm facing this problem. I have a dynamic &lt;STRONG&gt;fileName&lt;/STRONG&gt;. &lt;BR /&gt;The filename that I want to read changes everyday.&lt;BR /&gt;It works fine before I package the code using the splunk streaming command.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;with open('C:\Users\Desktop\%s\%s\%s'%('assetfiles','DailySchedule',fileName)) as csv_file:&lt;/STRONG&gt;&lt;BR /&gt;This will give me:&lt;BR /&gt;C:\Users\KGQJ3999\Desktop\assetfiles\assetfiles\DailySchedule\2019-12-20_NAME1.csv&lt;/P&gt;
&lt;P&gt;However, after packaging it into the streaming command, it's giving me this.&lt;BR /&gt;C:\Users\KGQJ3999\Desktop\assetfiles\assetfiles\DailySchedule\ .csv&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Anybody has any idea why??&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:37:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Python-Command-to-read-a-CSV-file/m-p/471411#M8460</guid>
      <dc:creator>marvinlee93</dc:creator>
      <dc:date>2020-06-07T18:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Python Command to read a CSV file</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Custom-Python-Command-to-read-a-CSV-file/m-p/471412#M8461</link>
      <description>&lt;P&gt;Is fileName a field that exists in your search results immediately before you | to your custom command? If not, I would have expected the script to error out (missing a required arg?) but perhaps it's carrying on with null/empty value and that's why you're getting a csv with no name?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 12:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Custom-Python-Command-to-read-a-CSV-file/m-p/471412#M8461</guid>
      <dc:creator>martynoconnor</dc:creator>
      <dc:date>2019-12-21T12:06:22Z</dc:date>
    </item>
  </channel>
</rss>

