<?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: Alerting: Send ip/user to script as a parameter in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72734#M1002</link>
    <description>&lt;P&gt;All the results are saved in a csv file.  One of the arguments passed in to every script is the full path to the results.csv file.  So have your script open that file and parse the events.&lt;BR /&gt;
If you are using Windows, you might find it easier to use the environment variables rather than script arguments because I have found that Windows does not cope with arguments that have whitespace in them.  The documentation is here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3/Admin/Configurescriptedalerts"&gt;Configurescriptedalerts&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2012 16:03:18 GMT</pubDate>
    <dc:creator>itinney</dc:creator>
    <dc:date>2012-02-16T16:03:18Z</dc:date>
    <item>
      <title>Alerting: Send ip/user to script as a parameter</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72733#M1001</link>
      <description>&lt;P&gt;I have an alert that tells me whenever a failed authentication happens on our devices.  Currently, its action is to call a batch (later python) script that does a net send to our xp machines saying that a failed authentication occurred.  We want to add in some usable data to this alert so we don't have to check Splunk each time for what happened.&lt;/P&gt;

&lt;P&gt;Is it possible to add data from the returned search as a parameter to the script, as either a parameter or environmental variable?&lt;/P&gt;

&lt;P&gt;Edit:  My answer may be somewhere in here: &lt;A href="http://splunk-base.splunk.com/answers/3019/scripted-alert-question"&gt;http://splunk-base.splunk.com/answers/3019/scripted-alert-question&lt;/A&gt;.  I'll post my solution if I come up with one.&lt;/P&gt;

&lt;P&gt;2nd Edit:  I wrote a couple python scripts to handle Failed Authentication to network devices, as well as alerts for when Port Security is tripped.  You can find them here: &lt;A href="https://github.com/hortonew/ServerBackups/tree/master/scripts/python/Splunk"&gt;https://github.com/hortonew/ServerBackups/tree/master/scripts/python/Splunk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 13:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72733#M1001</guid>
      <dc:creator>hortonew</dc:creator>
      <dc:date>2012-02-16T13:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting: Send ip/user to script as a parameter</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72734#M1002</link>
      <description>&lt;P&gt;All the results are saved in a csv file.  One of the arguments passed in to every script is the full path to the results.csv file.  So have your script open that file and parse the events.&lt;BR /&gt;
If you are using Windows, you might find it easier to use the environment variables rather than script arguments because I have found that Windows does not cope with arguments that have whitespace in them.  The documentation is here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3/Admin/Configurescriptedalerts"&gt;Configurescriptedalerts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 16:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72734#M1002</guid>
      <dc:creator>itinney</dc:creator>
      <dc:date>2012-02-16T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting: Send ip/user to script as a parameter</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72735#M1003</link>
      <description>&lt;P&gt;Thanks.  Last time I tried calling a python script straight from the Splunk alert system, it didn't get executed.  Any idea why?  Would it have something to do with not having a python path at the top of the script? If so, what should I put for it to use Splunk's version of python?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 16:21:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-Send-ip-user-to-script-as-a-parameter/m-p/72735#M1003</guid>
      <dc:creator>hortonew</dc:creator>
      <dc:date>2012-02-16T16:21:36Z</dc:date>
    </item>
  </channel>
</rss>

