<?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: Custom Conditions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90819#M23338</link>
    <description>&lt;P&gt;Are there any fields in this event, or is this string the contents of a single field?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2013 20:00:06 GMT</pubDate>
    <dc:creator>lukejadamec</dc:creator>
    <dc:date>2013-10-09T20:00:06Z</dc:date>
    <item>
      <title>Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90818#M23337</link>
      <description>&lt;P&gt;I am new to splunk and want to create an alert for switch ports that flap.  So, I need a way to alert if a port on a given switch goes up and down more than a certain number of times per minute.  How can I setup the search/alert for that?  Below is an example of the search results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Oct  9 12:01:18 hos-a-3550-1.rockefeller.internal 2635634: Oct  9 12:01:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2013 16:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90818#M23337</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-09T16:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90819#M23338</link>
      <description>&lt;P&gt;Are there any fields in this event, or is this string the contents of a single field?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2013 20:00:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90819#M23338</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-09T20:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90820#M23339</link>
      <description>&lt;P&gt;single  field&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2013 14:10:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90820#M23339</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-10T14:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90821#M23340</link>
      <description>&lt;P&gt;That should be pretty easy then.  You'll need to use rex to extract the FastEthernet0/3 and the 'changed to down/up' information as fields in the search, then you can run statistics on them, and alert when the number for an interface is higher than you'd like.&lt;/P&gt;

&lt;P&gt;Try to create the extractions with Field Extractor (down arrow key next to the event).  It is easy to use and works most of the time.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2013 14:22:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90821#M23340</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-10T14:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90822#M23341</link>
      <description>&lt;P&gt;I created a field extraction for FastEthernet0/3 and when I test it gives me the right list of values.  I also created an even type for the Up/Down events.   My problem is I don't know what to do next.  Do I need to extract the Etehrnet field and the Up/Down together in one field or separate fields.  And then I'm not sure what stats to run.  I've read about count and distinct count ,but I'm not sure how to formulate the query from there.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 12:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90822#M23341</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-11T12:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90823#M23342</link>
      <description>&lt;P&gt;We can help with that.  I'm not the best with this sort of search, but a lot of folks are. &lt;BR /&gt;
What did you name the fields?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90823#M23342</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-11T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90824#M23343</link>
      <description>&lt;P&gt;In Field Extractions I've got "interface" and 'up-down".&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90824#M23343</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-11T14:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90825#M23344</link>
      <description>&lt;P&gt;Try this and see if it gives you the results you want.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=yourindex sourcetype=yoursourcetype interface="*" up-down="*" |stats count by interface,up-down | where count&amp;gt;1000 |table interface,up-down,count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Change the 1000 to what ever value you want.  &lt;/P&gt;

&lt;P&gt;From the time picker on the right, select real time 1 minute window.&lt;BR /&gt;
From the Create dropdown on the right, select Alert.&lt;/P&gt;

&lt;P&gt;If you want to extract the fields in the search then you can use rex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourindex sourcetype=yoursourcetype | rex "interface (?&amp;lt;Interface&amp;gt;[^, ]*), changed state to (?&amp;lt;state&amp;gt;\w+)" |stats count by Interface,state | where count&amp;gt;1000| table Interface state
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90825#M23344</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-11T14:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90826#M23345</link>
      <description>&lt;P&gt;Am i supposed to put something in the quotes?  I get no results.&lt;/P&gt;

&lt;P&gt;I could have any number of different interfaces go up and down and I want to see the ones that go up and down a lot. I don't care about the ones that just up and down once or twice.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90826#M23345</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-11T15:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90827#M23346</link>
      <description>&lt;P&gt;Sorry, the * were stripped out. I'll fix it.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:17:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90827#M23346</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-11T15:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90828#M23347</link>
      <description>&lt;P&gt;The way this search works is it works with your log event triggers.  For any particular interface you will only get this event when the state changes from up to down or down to up, so for any particular interface over the course of a minute you get &amp;gt;x number of state changes it will show up in the table.  You decide what x should be.&lt;/P&gt;

&lt;P&gt;Set the number to 0 for testing.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90828#M23347</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-11T15:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90829#M23348</link>
      <description>&lt;P&gt;I'm heading offline for about 8 hours.  I know this works because I tested on windows EventCodes,ComputerName log entries per minute.  Good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:28:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90829#M23348</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-11T15:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90830#M23349</link>
      <description>&lt;P&gt;If you're going to search over a time range and want to know if you were flapping during any 1 minute in the time range:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | bucket span=1m _time | stats count by interface host _time | where count&amp;gt;1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you just want to check the last minute:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; earliest=-1m@m latest=@m | stats count by interface host | where count&amp;gt;1000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90830#M23349</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2013-10-11T15:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90831#M23350</link>
      <description>&lt;P&gt;While I wating, I tried the * and that worked for the "interface" field I created, but not for the "up-down" field.  Not sure the up-down field is working right.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90831#M23350</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-11T15:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90832#M23351</link>
      <description>&lt;P&gt;The up-down field should be included in the field list to the right.  The field name will be case sensitive.&lt;BR /&gt;
Also, for testing you should search a large enough timespan to ensure you are getting some events with up-down values.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:38:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90832#M23351</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-11T15:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90833#M23352</link>
      <description>&lt;P&gt;I am typing the field name right...it does not show up.  The time frame is plenty, since i'm seeing these literally every second.  I tested the extraction while creating it and it worked so I'm confused why it won't work with a search.  The interface extraction works fine.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 19:09:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90833#M23352</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-11T19:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90834#M23353</link>
      <description>&lt;P&gt;Perhaps you need an inline field extraction.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2013 00:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90834#M23353</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-10-12T00:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90835#M23354</link>
      <description>&lt;P&gt;Why don't you try the Cisco IOS app out? All the extractions are there. You just need to set up the alert.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2013 11:07:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90835#M23354</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2013-10-12T11:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90836#M23355</link>
      <description>&lt;P&gt;I just tried your suggestion and after installing the app it gives me 4 errors while loading saying it cannot find search module and it has been loading  for 15 minutes with no apparent progress.  This won't work for me.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2013 12:17:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90836#M23355</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-12T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90837#M23356</link>
      <description>&lt;P&gt;Nevermind....I failed to read the doc about the dependencies...silly me.  I got it installed properly now.  I will see if it does what I want.  I really wanted to learn the regex stuff, but maybe this will get me by for now.  Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2013 12:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Custom-Conditions/m-p/90837#M23356</guid>
      <dc:creator>exd42062</dc:creator>
      <dc:date>2013-10-12T12:26:02Z</dc:date>
    </item>
  </channel>
</rss>

