Developing for Splunk Enterprise

Problem with splunk and python commands in unix

New Member
splunkmonitormessage= subprocess.Popen(["sudo", "/opt/splunkforwarder/bin/splunk", "add monitor", path], stdin=subprocess.PIPE, stdout=subprocess.PIPE)

is throwing an error:

Command error: The subcommand
is not valid for command 'add
monitor'. Data forwarding
configuration management tools.

enable local-index [-parameter ] ...
disable local-index [-parameter ] ...
display local-index
add [forward-server|search-server] server
remove [forward-server|search-server] server
list [forward-server|search-server]

forward-server a Splunk forwarder to forward data to be
search-server a Splunk server to forward searches
local-index a local search index on the Splunk server

sudo /opt/splunkforwarder/bin/splunk add monitor /opt/logs/node_Default_Node.log

works comepletely fine

What am I doing wrong?

Ive also tried str(path) in the python

Tags (3)
0 Karma

New Member

answer found here

0 Karma