<?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: Search to display a table of only Active alerts in time frame in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202997#M58956</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="orion" sourcetype=traps | rex "cyan\.6\.1\.1\.10\..\:\=\s(?&amp;lt;state&amp;gt;.*)" | rex "cyan\.6\.1\.1\.3\..\:\=(?&amp;lt;cyan_node&amp;gt;.*)" | eval trap_state=case(state==0, "Cleared", state==1, "Active", state==2, "Disabled")  | stats latest(_time) as _time values(trap_state) as trap_state by cyan_node | where mvcount(trap_state)=1 AND trap_state="Active" | table cyan_node, trap_state, _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Apr 2016 21:14:47 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-04-14T21:14:47Z</dc:date>
    <item>
      <title>Search to display a table of only Active alerts in time frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202994#M58953</link>
      <description>&lt;P&gt;I am trying to build a table that will show the &lt;EM&gt;active&lt;/EM&gt; alerts for SNMP trap data ingested via a text file. &lt;/P&gt;

&lt;P&gt;I can build a table pretty well extracting fields with &lt;STRONG&gt;rex&lt;/STRONG&gt; and displaying them using &lt;STRONG&gt;table&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="orion" sourcetype=traps | rex "cyan\.6\.1\.1\.10\..\:\=\s(?&amp;lt;state&amp;gt;.*)" | rex "cyan\.6\.1\.1\.3\..\:\=(?&amp;lt;cyan_node&amp;gt;.*)" | eval trap_state=case(state==0, "Cleared", state==1, "Active", state==2, "Disabled")  | table cyan_node, trap_state, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This along with other rex statements on the other OID's in the trap message build a nice human-readable table of the Node Name, Alarm State, and Time. &lt;/P&gt;

&lt;P&gt;However, what I want to do is to only show the events that eval cyan.6.1.1.10.0:= 1 to "Active" and have no preceding cyan.6.1.1.10.0:= 0 or "Clear" &lt;/P&gt;

&lt;P&gt;In other words, just show me Active alarms that have never had a Clear status. I do not have any idea on how to go about this.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:30:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202994#M58953</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-04-14T16:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search to display a table of only Active alerts in time frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202995#M58954</link>
      <description>&lt;P&gt;Try this, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="orion" sourcetype=traps "cyan.6.1.1.10.0:= 1" | rex "cyan\.6\.1\.1\.10\..\:\=\s(?&amp;lt;state&amp;gt;.*)" | rex "cyan\.6\.1\.1\.3\..\:\=(?&amp;lt;cyan_node&amp;gt;.*)" | eval trap_state=case(state==0, "Cleared", state==1, "Active", state==2, "Disabled")  | table cyan_node, trap_state, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="orion" sourcetype=traps | rex "cyan\.6\.1\.1\.10\..\:\=\s(?&amp;lt;state&amp;gt;.*)" | rex "cyan\.6\.1\.1\.3\..\:\=(?&amp;lt;cyan_node&amp;gt;.*)" | eval trap_state=case(state==0, "Cleared", state==1, "Active", state==2, "Disabled") |search trap_state="Active" | table cyan_node, trap_state, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After your extraction you can use &lt;STRONG&gt;search or where&lt;/STRONG&gt;.. like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|search trap_state="Active" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|where trap_state="Active"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can move your rex in props.conf (extract, calculated fields). then you can directly search the required field. In other hand If you can share some sample data I can help you the easy way.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
V&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202995#M58954</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2016-04-14T16:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Search to display a table of only Active alerts in time frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202996#M58955</link>
      <description>&lt;P&gt;While this will work to get a table of &lt;STRONG&gt;all&lt;/STRONG&gt; the snmp traps that have come in as "active", what I am trying to do is to display all the traps that have come in as an alarm indicator that have NOT had a snmp trap come in with a clear indicator to negate them. &lt;/P&gt;

&lt;P&gt;See this image for further reference. Since there was a Clear for the Active, there should be no need to display either event:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://i.imgur.com/habLLYN.png"&gt;http://i.imgur.com/habLLYN.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 18:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202996#M58955</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-04-14T18:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search to display a table of only Active alerts in time frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202997#M58956</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index="orion" sourcetype=traps | rex "cyan\.6\.1\.1\.10\..\:\=\s(?&amp;lt;state&amp;gt;.*)" | rex "cyan\.6\.1\.1\.3\..\:\=(?&amp;lt;cyan_node&amp;gt;.*)" | eval trap_state=case(state==0, "Cleared", state==1, "Active", state==2, "Disabled")  | stats latest(_time) as _time values(trap_state) as trap_state by cyan_node | where mvcount(trap_state)=1 AND trap_state="Active" | table cyan_node, trap_state, _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202997#M58956</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-14T21:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Search to display a table of only Active alerts in time frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202998#M58957</link>
      <description>&lt;P&gt;I do not get any results when I run that search. I am still trying to sort out exactly what you are doing there as I am still very new to Splunk and not too familiar with a lot of the commands. &lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2016 14:32:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202998#M58957</guid>
      <dc:creator>evan_roggenkamp</dc:creator>
      <dc:date>2016-04-18T14:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Search to display a table of only Active alerts in time frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202999#M58958</link>
      <description>&lt;P&gt;Before stats is the search same as your's in the question. Using stats, I'm taking the time of the latest event and all the available values of trap_state for a cyan_node. Then based on available values of trap_state, I'm removing events where trap_state has both Active and Cleared/Disabled state (showing only the active alarms) and keeping only with alarm state with Active.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-display-a-table-of-only-Active-alerts-in-time-frame/m-p/202999#M58958</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T09:30:12Z</dc:date>
    </item>
  </channel>
</rss>

