<?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: Find results based on field value of 2 events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110986#M29042</link>
    <description>&lt;P&gt;Thanks MuS!&lt;/P&gt;

&lt;P&gt;With some modifications of your search the solution is:&lt;/P&gt;

&lt;P&gt;index=_internal message ="yes" OR message ="no"| eval message=lower(message) | eventstats count(eval(message ="yes")) as yes_count count(eval(message ="no")) as no_count by msisdn  | where yes_count&amp;gt;0 AND no_count&amp;gt;0 | table _time, msisdn, message&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:15:41 GMT</pubDate>
    <dc:creator>carljohan</dc:creator>
    <dc:date>2020-09-28T16:15:41Z</dc:date>
    <item>
      <title>Find results based on field value of 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110982#M29038</link>
      <description>&lt;P&gt;I have a logfile in the following format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[2014-27-03 20:57:15.875 CST] [receivedSmsFileLogger] - message = "Yes", msisdn = "00000000"
[2014-27-03 21:06:21.787 CST] [receivedSmsFileLogger] - message = "Yes", msisdn = "11111111"
[2014-27-03 21:10:28.529 CST] [receivedSmsFileLogger] - message = "Yes", msisdn = "22222222"
[2014-27-03 21:30:51.651 CST] [receivedSmsFileLogger] - message = "No", msisdn = "11111111"
[2014-27-03 21:47:39.900 CST] [receivedSmsFileLogger] - message = "Yes", msisdn = "33333333"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to find any msisdn which sent both yes and no in the same day and display them like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014-27-03 21:06:21.787 CST] [receivedSmsFileLogger] - message = "Yes", msisdn = "11111111"
2014-27-03 21:30:51.651 CST] [receivedSmsFileLogger] - message = "No", msisdn = "11111111"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any suggestions on how that search query would be written?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATE: Solution as per MuS answer:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal message ="yes" OR message ="no"| eval message=lower(message) | eventstats count(eval(message ="yes")) as yes_count count(eval(message ="no")) as no_count by msisdn  | where yes_count&amp;gt;0 AND no_count&amp;gt;0 | table _time, msisdn, message
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Mar 2014 09:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110982#M29038</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2014-03-28T09:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find results based on field value of 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110983#M29039</link>
      <description>&lt;P&gt;Hi carljohan,&lt;/P&gt;

&lt;P&gt;try something like this, it is a run everywhere example and you must adapt it to your needs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal method="GET" OR method="POST" | eventstats count(clientip) as ip_count by method  | where ip_count&amp;gt;2 | dedup clientip  | table clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will search for all GET and POST, count IP's for each method and show only IP's which count is more then 2 because only those will have both GET and POST.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 09:56:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110983#M29039</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-28T09:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find results based on field value of 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110984#M29040</link>
      <description>&lt;P&gt;Hi MuS&lt;/P&gt;

&lt;P&gt;This gave me all msisdn that sent either:&lt;BR /&gt;
yes&lt;BR /&gt;
no&lt;BR /&gt;
yes or no&lt;/P&gt;

&lt;P&gt;I only want msisdn that send yes and no.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 10:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110984#M29040</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2014-03-28T10:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Find results based on field value of 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110985#M29041</link>
      <description>&lt;P&gt;index=_internal method="GET" OR method="POST" | eventstats count(eval(method="GET")) as GET_count count(eval(method="POST")) as POST_count by clientip  | where GET_count&amp;gt;1 AND POST_count&amp;gt;1  | dedup clientip  | table clientip, GET_count, POST_count&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110985#M29041</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-09-28T16:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find results based on field value of 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110986#M29042</link>
      <description>&lt;P&gt;Thanks MuS!&lt;/P&gt;

&lt;P&gt;With some modifications of your search the solution is:&lt;/P&gt;

&lt;P&gt;index=_internal message ="yes" OR message ="no"| eval message=lower(message) | eventstats count(eval(message ="yes")) as yes_count count(eval(message ="no")) as no_count by msisdn  | where yes_count&amp;gt;0 AND no_count&amp;gt;0 | table _time, msisdn, message&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110986#M29042</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2020-09-28T16:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find results based on field value of 2 events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110987#M29043</link>
      <description>&lt;P&gt;you're welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2014 11:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-results-based-on-field-value-of-2-events/m-p/110987#M29043</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-28T11:07:21Z</dc:date>
    </item>
  </channel>
</rss>

