<?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 Filter event data using conditions within the data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517775#M145615</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have some data which in the below form:&lt;/P&gt;&lt;TABLE border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;JOB&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;EVENT&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TYPE&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TIME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;A&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;20&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;B&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;15&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;C&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;10&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;A&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;15&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;B&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;10&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;C&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;20&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to filter the data only for those event which has the greater value of Type A.&lt;/P&gt;&lt;P&gt;So, here in my example, Event 1 has value of A=20 and Event 2 has value of A=15. So, here Event 1 has value of A greater than value of A in Event 2. So I want to see the results of Event 1 only. My result should be something like below:&lt;/P&gt;&lt;TABLE border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;JOB-NO&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;EVENT&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TYPE&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TIME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;A&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;B&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;C&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Sep 2020 17:37:55 GMT</pubDate>
    <dc:creator>subhrangshu</dc:creator>
    <dc:date>2020-09-03T17:37:55Z</dc:date>
    <item>
      <title>Filter event data using conditions within the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517775#M145615</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have some data which in the below form:&lt;/P&gt;&lt;TABLE border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;JOB&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;EVENT&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TYPE&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TIME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;A&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;20&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;B&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;15&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;C&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#FF0000"&gt;10&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;A&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;15&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;B&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;10&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;C&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;&lt;FONT color="#0000FF"&gt;20&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to filter the data only for those event which has the greater value of Type A.&lt;/P&gt;&lt;P&gt;So, here in my example, Event 1 has value of A=20 and Event 2 has value of A=15. So, here Event 1 has value of A greater than value of A in Event 2. So I want to see the results of Event 1 only. My result should be something like below:&lt;/P&gt;&lt;TABLE border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;JOB-NO&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;EVENT&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TYPE&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;TIME&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;A&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;B&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="63px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;1&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;C&lt;/TD&gt;&lt;TD width="64px" height="15px"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 17:37:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517775#M145615</guid>
      <dc:creator>subhrangshu</dc:creator>
      <dc:date>2020-09-03T17:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter event data using conditions within the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517778#M145617</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you can use&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;&amp;lt;your base query&amp;gt;
| stats values(job) as job values(event) as event max(time) as time by type
| table job event type time&lt;/LI-CODE&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 17:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517778#M145617</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-09-03T17:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filter event data using conditions within the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517785#M145619</link>
      <description>&lt;P&gt;A subsearch should do the job.&amp;nbsp; The subsearch looks for the highest value of A and returns the event number.&amp;nbsp; Then the main search returns the results with that event number.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo [ index=foo TYPE="A" 
  | search TYPE="A" 
  | stats max(TIME) as MAXTIME by EVENT
  | sort - MAXTIME
  | head 1
  | return EVENT
  ]&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Sep 2020 18:14:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517785#M145619</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-03T18:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter event data using conditions within the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517858#M145640</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works as I wanted. Just one more add on query to it, when we return EVENT, suppose I want to use the EVENT value in some other way in my main search. For example:&lt;/P&gt;&lt;P&gt;If event =1, then my main search should be something like index=FOO AND source=some path\1\log.txt&lt;/P&gt;&lt;P&gt;If event =2, then my main search should be something like index=FOO AND source=some path\2\log.txt&lt;/P&gt;&lt;P&gt;Basically, I want to use the event value returned into my main search with some modification as stated above.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 06:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517858#M145640</guid>
      <dc:creator>subhrangshu</dc:creator>
      <dc:date>2020-09-04T06:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter event data using conditions within the data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517913#M145659</link>
      <description>&lt;P&gt;That changes the subsearch slightly.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo [ index=foo TYPE="A" 
  | search TYPE="A" 
  | stats max(TIME) as MAXTIME by EVENT
  | sort - MAXTIME
  | head 1
  | eval source=case(EVENT=1,"some path", EVENT=2, "some other path", 1==1, "*")
  | return source
  ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Sep 2020 12:54:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-event-data-using-conditions-within-the-data/m-p/517913#M145659</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-04T12:54:12Z</dc:date>
    </item>
  </channel>
</rss>

