<?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 Could i input parameter to my custom script from Search? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Could-i-input-parameter-to-my-custom-script-from-Search/m-p/659157#M11187</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I try to develop a custom Python script and i want to input parameter from Search to my script. Could i do it?&lt;/P&gt;&lt;P&gt;Example my script name is compare (already register on searchhead), and it need 2 parameter to work, like:&amp;nbsp;&amp;nbsp;| makeresults a=1 | compare file1.csv file2.csv (file1.csv, file2.csv is parameter).&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Sep 2023 04:15:55 GMT</pubDate>
    <dc:creator>TNV20</dc:creator>
    <dc:date>2023-09-30T04:15:55Z</dc:date>
    <item>
      <title>Could i input parameter to my custom script from Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Could-i-input-parameter-to-my-custom-script-from-Search/m-p/659157#M11187</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I try to develop a custom Python script and i want to input parameter from Search to my script. Could i do it?&lt;/P&gt;&lt;P&gt;Example my script name is compare (already register on searchhead), and it need 2 parameter to work, like:&amp;nbsp;&amp;nbsp;| makeresults a=1 | compare file1.csv file2.csv (file1.csv, file2.csv is parameter).&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 04:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Could-i-input-parameter-to-my-custom-script-from-Search/m-p/659157#M11187</guid>
      <dc:creator>TNV20</dc:creator>
      <dc:date>2023-09-30T04:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Could i input parameter to my custom script from Search?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Could-i-input-parameter-to-my-custom-script-from-Search/m-p/659169#M11188</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/261067"&gt;@TNV20&lt;/a&gt;&amp;nbsp;- If you are using Splunklib (Splunk-SDK-Python) then you could do it with Option.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/DocumentationStatic/PythonSDK/1.7.2/searchcommands.html" target="_blank"&gt;https://docs.splunk.com/DocumentationStatic/PythonSDK/1.7.2/searchcommands.html&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from splunklib.searchcommands.decorators import Option

file1 = Option(
    doc=''' **Syntax:** **file=***&amp;lt;file1&amp;gt;*
    **Description:** Name of the first file''',
    require=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you can use it like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| compare file1="file1.csv" file2="file2.csv"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2023 07:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Could-i-input-parameter-to-my-custom-script-from-Search/m-p/659169#M11188</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2023-09-30T07:51:48Z</dc:date>
    </item>
  </channel>
</rss>

