<?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 Looking for an example generating custom script that execute OS command in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Looking-for-an-example-generating-custom-script-that-execute-OS/m-p/256833#M3204</link>
    <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I am looking for a simple example of custom generating search command that &lt;BR /&gt;
executes OS command and show the result of execution.&lt;/P&gt;

&lt;P&gt;I don't have much knowledge of Python SDK, but I want to start from an simple example.&lt;/P&gt;

&lt;P&gt;Thank you, and any commend would be appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2016 13:53:49 GMT</pubDate>
    <dc:creator>melonman</dc:creator>
    <dc:date>2016-03-22T13:53:49Z</dc:date>
    <item>
      <title>Looking for an example generating custom script that execute OS command</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Looking-for-an-example-generating-custom-script-that-execute-OS/m-p/256833#M3204</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I am looking for a simple example of custom generating search command that &lt;BR /&gt;
executes OS command and show the result of execution.&lt;/P&gt;

&lt;P&gt;I don't have much knowledge of Python SDK, but I want to start from an simple example.&lt;/P&gt;

&lt;P&gt;Thank you, and any commend would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 13:53:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Looking-for-an-example-generating-custom-script-that-execute-OS/m-p/256833#M3204</guid>
      <dc:creator>melonman</dc:creator>
      <dc:date>2016-03-22T13:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for an example generating custom script that execute OS command</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Looking-for-an-example-generating-custom-script-that-execute-OS/m-p/256834#M3205</link>
      <description>&lt;P&gt;Its better if you do this in a separate/new app.&lt;/P&gt;

&lt;P&gt;In local directory of app, create commands.conf (if it is already not there).&lt;BR /&gt;
Commands.conf&lt;BR /&gt;
[cachecheck]&lt;BR /&gt;
filename=command_cachecheck.py&lt;/P&gt;

&lt;P&gt;In bin directory of app create command_cachecheck.py&lt;BR /&gt;
import os,re,csv&lt;BR /&gt;
import sys&lt;BR /&gt;
os.system("data \" +%c\" ")&lt;BR /&gt;
command = 'vmstat -s'&lt;BR /&gt;
os.system(command)&lt;/P&gt;

&lt;P&gt;Restart searchhead and  give proper permissions.  &lt;/P&gt;

&lt;P&gt;In SH get the results by searching |cachecheck.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2016 18:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Looking-for-an-example-generating-custom-script-that-execute-OS/m-p/256834#M3205</guid>
      <dc:creator>kamal_jagga</dc:creator>
      <dc:date>2016-03-25T18:40:07Z</dc:date>
    </item>
  </channel>
</rss>

