<?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: Scripting, Search, Passing Vars in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73572#M4646</link>
    <description>&lt;P&gt;Assuming you already have the src_ip field being extracted, you need a stats command to build a count. Try the following search over a relevant time period:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;seclogin: "Login failed" "invalid user" | stats count by src_ip | where count&amp;gt;20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Dec 2012 22:30:44 GMT</pubDate>
    <dc:creator>BobM</dc:creator>
    <dc:date>2012-12-27T22:30:44Z</dc:date>
    <item>
      <title>Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73571#M4645</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;

&lt;P&gt;I am trying to setup up Splunk to count the failed login attempts on our firewall and then run a script that will login to the firewall and block said IP address.&lt;/P&gt;

&lt;P&gt;Currently, I have it setup to capture failed login attempts and run the default script (echo.sh) for testing purposes.&lt;/P&gt;

&lt;P&gt;My questions is, how do I count and pass the IP address after “from” in the log below?&lt;/P&gt;

&lt;P&gt;Dec 27 15:37:36 192.168.4.1  seclogin: [2012 Dec 27 15:37:36] UTM5 Login failed: invalid user sdhsdh from 192.168.4.3&lt;/P&gt;

&lt;P&gt;Do I have to create a field type or use the field extractor? How does either, affect Splunks outputs listed here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Alert/Configuringscriptedalerts"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/Alert/Configuringscriptedalerts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2012 22:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73571#M4645</guid>
      <dc:creator>username9000</dc:creator>
      <dc:date>2012-12-27T22:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73572#M4646</link>
      <description>&lt;P&gt;Assuming you already have the src_ip field being extracted, you need a stats command to build a count. Try the following search over a relevant time period:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;seclogin: "Login failed" "invalid user" | stats count by src_ip | where count&amp;gt;20
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Dec 2012 22:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73572#M4646</guid>
      <dc:creator>BobM</dc:creator>
      <dc:date>2012-12-27T22:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73573#M4647</link>
      <description>&lt;P&gt;Hi Bob,&lt;/P&gt;

&lt;P&gt;No I have not extracted the src_ip field. Am I to define a regular expression to extract the IP or is there a more friendly GUI approach?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 14:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73573#M4647</guid>
      <dc:creator>username9000</dc:creator>
      <dc:date>2012-12-28T14:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73574#M4648</link>
      <description>&lt;P&gt;The interactive field extractor can do this for you. &lt;BR /&gt;
There is a quick 3min video here &lt;A href="http://www.splunk.com/view/SP-CAAADUY"&gt;http://www.splunk.com/view/SP-CAAADUY&lt;/A&gt;&lt;BR /&gt;
and the docs are here &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 14:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73574#M4648</guid>
      <dc:creator>BobM</dc:creator>
      <dc:date>2012-12-28T14:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73575#M4649</link>
      <description>&lt;P&gt;The logs only have one IP address in them (192.168.4.3), by using the GUI will it account for IP addresses that vary in the individual octet? For example, 17.45.252.1? etc? Or do i need to edit the rex syntax? I receive an error message for entering IP addresses that are not found within the log.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 16:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73575#M4649</guid>
      <dc:creator>username9000</dc:creator>
      <dc:date>2012-12-28T16:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73576#M4650</link>
      <description>&lt;P&gt;The regex should be generic and accept any numbers.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 16:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73576#M4650</guid>
      <dc:creator>BobM</dc:creator>
      <dc:date>2012-12-28T16:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting, Search, Passing Vars</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73577#M4651</link>
      <description>&lt;P&gt;I found this in another thread, seems to have done the trick.&lt;/P&gt;

&lt;P&gt;\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})"&lt;/P&gt;

&lt;P&gt;thx for ur help&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 16:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Scripting-Search-Passing-Vars/m-p/73577#M4651</guid>
      <dc:creator>username9000</dc:creator>
      <dc:date>2012-12-28T16:20:50Z</dc:date>
    </item>
  </channel>
</rss>

