<?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 Re: Run Collect command from python giving error in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177171#M1641</link>
    <description>&lt;P&gt;Hi &lt;BR /&gt;
Thanks for your response. I am trying to add two parameters through marker field (searchname and test cycle number, basically tagging my events with additional key-value pairs). When I run it through web, it works fine:&lt;/P&gt;

&lt;P&gt;| savedsearch test1 | collect index=testsummary marker="searchname=test1, cycle=1"&lt;/P&gt;

&lt;P&gt;index=testsummary --&amp;gt; this has results of savedsearch "test1" with two additional fields in the event searchname and cycle. But why the same command through python script is failing to add the 2nd key-value pair.&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
Mehala&lt;/P&gt;</description>
    <pubDate>Tue, 17 Mar 2015 09:42:51 GMT</pubDate>
    <dc:creator>mehala12</dc:creator>
    <dc:date>2015-03-17T09:42:51Z</dc:date>
    <item>
      <title>Run Collect command from python giving error</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177169#M1639</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I am trying to run collect command from python script. Below is my command:&lt;/P&gt;

&lt;P&gt;check_output("%s search \"| savedsearch splunkit_search_chart | addinfo | &lt;STRONG&gt;collect index=%s marker=\"searchname=search_chart1, cycle=1&lt;/STRONG&gt;\" \"  %s:%s" % (splunkCmdPath,idxName,USERNAME,PASSWORD))&lt;/P&gt;

&lt;P&gt;The python script runs fine if I specify only one marker variable (searchname). When more than 1 marker variable is added, separated by comma, it gives me below error:&lt;BR /&gt;
FATAL: Error in 'collect' command: Invalid argument: 'cycle=1'&lt;/P&gt;

&lt;P&gt;Through splunk web, i could add any no. of variables using marker parameter. Did anyone face this error? Please let me know where am i going wrong.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Mehala&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177169#M1639</guid>
      <dc:creator>mehala12</dc:creator>
      <dc:date>2020-09-28T19:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run Collect command from python giving error</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177170#M1640</link>
      <description>&lt;UL&gt;
&lt;LI&gt; "&lt;STRONG&gt;cycle&lt;/STRONG&gt;" is not a argument  for the collect command&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Optional arguments for the collect command are:&lt;/P&gt;

&lt;P&gt;addtime=&lt;BOOL&gt; | file=&lt;STRING&gt; | spool=&lt;BOOL&gt; | marker=&lt;STRING&gt; | testmode=&lt;BOOL&gt; | run-in-preview=&lt;BOOL&gt;&lt;/BOOL&gt;&lt;/BOOL&gt;&lt;/STRING&gt;&lt;/BOOL&gt;&lt;/STRING&gt;&lt;/BOOL&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;note:&lt;/STRONG&gt;  Option 'marker' should not be specified more than once. &lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177170#M1640</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-03-17T09:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Run Collect command from python giving error</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177171#M1641</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
Thanks for your response. I am trying to add two parameters through marker field (searchname and test cycle number, basically tagging my events with additional key-value pairs). When I run it through web, it works fine:&lt;/P&gt;

&lt;P&gt;| savedsearch test1 | collect index=testsummary marker="searchname=test1, cycle=1"&lt;/P&gt;

&lt;P&gt;index=testsummary --&amp;gt; this has results of savedsearch "test1" with two additional fields in the event searchname and cycle. But why the same command through python script is failing to add the 2nd key-value pair.&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
Mehala&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:42:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Run-Collect-command-from-python-giving-error/m-p/177171#M1641</guid>
      <dc:creator>mehala12</dc:creator>
      <dc:date>2015-03-17T09:42:51Z</dc:date>
    </item>
  </channel>
</rss>

