<?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 How to pass a 'source path' to a script ? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-pass-a-source-path-to-a-script/m-p/487241#M8709</link>
    <description>&lt;P&gt;I am monitoring a location in my system.Whenever there is any new file in the location,I call a script using unarchive command in props.conf .I want to pass the source path of the new file in the location to the script?&lt;/P&gt;
&lt;P&gt;I am calling the script when there is a new file in my location using following configuration:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;input.conf
[monitor://C:\location\*.*]
index=test

props.conf
[source::C:\\location\*.*]
invalid_cause=archive
unarchive_cmd = path_to_script\\scriptName.py
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I know that I can pass arguments to script like following and access arguments as command line arguments in script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;props.conf
[source::C:\\location\*.*]
invalid_cause=archive
unarchive_cmd = path_to_script\\scriptName.py argument1 argument2
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please help me how to pass source path(the location of the new file,&lt;BR /&gt;which is triggering the call of script) to script.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jun 2020 18:45:45 GMT</pubDate>
    <dc:creator>jeswin96</dc:creator>
    <dc:date>2020-06-07T18:45:45Z</dc:date>
    <item>
      <title>How to pass a 'source path' to a script ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-pass-a-source-path-to-a-script/m-p/487241#M8709</link>
      <description>&lt;P&gt;I am monitoring a location in my system.Whenever there is any new file in the location,I call a script using unarchive command in props.conf .I want to pass the source path of the new file in the location to the script?&lt;/P&gt;
&lt;P&gt;I am calling the script when there is a new file in my location using following configuration:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;input.conf
[monitor://C:\location\*.*]
index=test

props.conf
[source::C:\\location\*.*]
invalid_cause=archive
unarchive_cmd = path_to_script\\scriptName.py
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I know that I can pass arguments to script like following and access arguments as command line arguments in script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;props.conf
[source::C:\\location\*.*]
invalid_cause=archive
unarchive_cmd = path_to_script\\scriptName.py argument1 argument2
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please help me how to pass source path(the location of the new file,&lt;BR /&gt;which is triggering the call of script) to script.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 18:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-pass-a-source-path-to-a-script/m-p/487241#M8709</guid>
      <dc:creator>jeswin96</dc:creator>
      <dc:date>2020-06-07T18:45:45Z</dc:date>
    </item>
  </channel>
</rss>

