<?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: Problem with splunk and python commands in unix in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Problem-with-splunk-and-python-commands-in-unix/m-p/197816#M2667</link>
    <description>&lt;P&gt;stackoverflow.com/a/24203342/3700086&lt;/P&gt;

&lt;P&gt;answer found here&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jun 2014 10:50:42 GMT</pubDate>
    <dc:creator>asimmons1</dc:creator>
    <dc:date>2014-06-13T10:50:42Z</dc:date>
    <item>
      <title>Problem with splunk and python commands in unix</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Problem-with-splunk-and-python-commands-in-unix/m-p/197815#M2666</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;splunkmonitormessage= subprocess.Popen(["sudo", "/opt/splunkforwarder/bin/splunk", "add monitor", path], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is throwing an error: &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Command error: The subcommand&lt;BR /&gt;
'/opt/logs/node_Default_Node.log'&lt;BR /&gt;
is not valid for command 'add&lt;BR /&gt;
monitor'. Data forwarding&lt;BR /&gt;
configuration management tools.&lt;BR /&gt;&lt;BR /&gt;
Commands:&lt;BR /&gt;
      enable local-index [-parameter &lt;VALUE&gt;] ...&lt;BR /&gt;
      disable local-index [-parameter &lt;VALUE&gt;] ...&lt;BR /&gt;
      display local-index&lt;BR /&gt;
      add [forward-server|search-server] server&lt;BR /&gt;
      remove [forward-server|search-server] server&lt;BR /&gt;
      list [forward-server|search-server]&lt;BR /&gt;&lt;BR /&gt;
Objects:&lt;BR /&gt;
      forward-server       a Splunk forwarder to forward data to be&lt;BR /&gt;
indexed&lt;BR /&gt;
      search-server        a Splunk server to forward searches&lt;BR /&gt;
      local-index          a local search index on the Splunk server&lt;/VALUE&gt;&lt;/VALUE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt;sudo /opt/splunkforwarder/bin/splunk add monitor /opt/logs/node_Default_Node.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;works comepletely fine&lt;/P&gt;

&lt;P&gt;What am I doing wrong?&lt;/P&gt;

&lt;P&gt;Ive also tried str(path) in the python&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Problem-with-splunk-and-python-commands-in-unix/m-p/197815#M2666</guid>
      <dc:creator>asimmons1</dc:creator>
      <dc:date>2020-09-28T16:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with splunk and python commands in unix</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Problem-with-splunk-and-python-commands-in-unix/m-p/197816#M2667</link>
      <description>&lt;P&gt;stackoverflow.com/a/24203342/3700086&lt;/P&gt;

&lt;P&gt;answer found here&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2014 10:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Problem-with-splunk-and-python-commands-in-unix/m-p/197816#M2667</guid>
      <dc:creator>asimmons1</dc:creator>
      <dc:date>2014-06-13T10:50:42Z</dc:date>
    </item>
  </channel>
</rss>

