<?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: Eval field based on similar events or single event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521557#M146985</link>
    <description>&lt;P&gt;how about something like this where you count up number of rows where your unique field occurs. In this example, i've made your unique field a combo of (servername, data1,data2, and data3)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval servername="one",data1="10",data2="20",data3="30",_time="09-02-2020"
| append
[| makeresults
| eval servername="one",data1="10",data2="20",data3="30",_time="09-01-2020"]
| append
[| makeresults
| eval servername="one",data1="10",data2="20",data3="30",_time="08-31-2020"]
| append
[| makeresults
| eval servername="two",data1="1",data2="2",data3="3",_time="09-02-2020"]
| append
[| makeresults
| eval servername="three",data1="1",data2="20",data3="30",_time="09-02-2020"]
| table servername,data1,data2,data3,_time
| eval uniquefield = servername.data1.data2.data3
| eventstats count by uniquefield
| eval occurence = if(count=1, "single","multiple")
| fields - count, - uniquefield&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 20:54:17 GMT</pubDate>
    <dc:creator>aa70627</dc:creator>
    <dc:date>2020-09-25T20:54:17Z</dc:date>
    <item>
      <title>Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521513#M146972</link>
      <description>&lt;P&gt;i have&amp;nbsp; a case where i need to determine if a row has been repeated multiple times or not .&lt;/P&gt;&lt;P&gt;it may have 4 common value columns, but time might differ. example below..&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;servername:data1:data2:data3:_time&lt;BR /&gt;server1:10:20:30:25th Sep 2020&lt;BR /&gt;server1:10:20:30:26th Sep 2020&lt;BR /&gt;server1:10:20:30:27th Sep 2020&lt;BR /&gt;server2:20:30:10:28thSep 2020&lt;/P&gt;&lt;P&gt;I need output like below with a new eval field called occurrence which should have values "mulitple", or "single" based on occurrence at different times.&lt;/P&gt;&lt;P&gt;can anyone help me with this, thanks..&lt;/P&gt;&lt;P&gt;servername:data1:data2:data3:_time:occurence&lt;BR /&gt;server1:10:20:30:25th Sep 2020:multiple&lt;BR /&gt;server1:10:20:30:26th Sep 2020:multiple&lt;BR /&gt;server1:10:20:30:27th Sep 2020:multiple&lt;BR /&gt;server2:20:30:10:28thSep 2020:single&lt;BR /&gt;server3:20:30:10:28thSep 2020:single&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 16:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521513#M146972</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-09-25T16:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521517#M146973</link>
      <description>&lt;P&gt;What criteria are you using to determine single or multiple?&lt;/P&gt;&lt;P&gt;Given&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;server1:10:20:30:25th Sep 2020:multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server1:10:20:30:26th Sep 2020:multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server1:10:20:30:27th Sep 2020:multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server2:20:30:10:28thSep 2020:single&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server3:20:30:10:28thSep 2020:single&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What would these be&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;server2:10:20:30:26th Sep 2020:?&lt;BR /&gt;server3:10:20:30:27th Sep 2020:?&lt;BR /&gt;server2:20:30:10:27thSep 2020:?&lt;BR /&gt;server2:20:30:10:28thSep 2020:?&lt;BR /&gt;server3:20:30:10:28thSep 2020:?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note that the last two are the same as yours but would this new data change their occurrence value?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 16:43:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521517#M146973</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-25T16:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521520#M146975</link>
      <description>&lt;P&gt;except the _time field, rest all fields have same values . that is the criteria...&lt;/P&gt;&lt;P&gt;or we can just ignore the _time field to determine similar rows .&lt;/P&gt;&lt;P&gt;if there are more than 1 rows that are similar then i would like to mark or eval them as multiple rows of same data.&lt;/P&gt;&lt;P&gt;else , if there are no multiple occurences of same data rows, then show them as single row...&lt;/P&gt;&lt;P&gt;the last 2 are different , as one is server 2 and other is server 3 ....&lt;/P&gt;&lt;P&gt;hope i was clear in my explanation...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;expected output:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;servername:data1:data2:data3:_time:occurence&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server1:10:20:30:25th Sep 2020:multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server1:10:20:30:26th Sep 2020:multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server1:10:20:30:27th Sep 2020:multiple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server2:20:30:10:28thSep 2020:single&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;server3:20:30:10:28thSep 2020:single&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 16:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521520#M146975</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-09-25T16:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521525#M146977</link>
      <description>&lt;P&gt;Perhaps the cluster command will do?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | cluster showcount=true 
| eval occurrence=if(cluster_count=1,"single","multiple")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 17:05:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521525#M146977</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-25T17:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521529#M146978</link>
      <description>&lt;P&gt;i tried ur suggestion, didnt work , below is the code i tried..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval servername="one",data1="10",data2="20",data3="30",_time="09-02-2020"&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval servername="one",data1="10",data2="20",data3="30",_time="09-01-2020"]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval servername="one",data1="10",data2="20",data3="30",_time="08-31-2020"]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval servername="two",data1="1",data2="2",data3="3",_time="09-02-2020"]&lt;BR /&gt;| append&lt;BR /&gt;[| makeresults&lt;BR /&gt;| eval servername="three",data1="1",data2="20",data3="30",_time="09-02-2020"]&lt;BR /&gt;| table servername,data1,data2,data3,_time&lt;BR /&gt;| cluster showcount=true | eval occurrence=if(cluster_count=1,"single","multiple")&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 17:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521529#M146978</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-09-25T17:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521557#M146985</link>
      <description>&lt;P&gt;how about something like this where you count up number of rows where your unique field occurs. In this example, i've made your unique field a combo of (servername, data1,data2, and data3)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval servername="one",data1="10",data2="20",data3="30",_time="09-02-2020"
| append
[| makeresults
| eval servername="one",data1="10",data2="20",data3="30",_time="09-01-2020"]
| append
[| makeresults
| eval servername="one",data1="10",data2="20",data3="30",_time="08-31-2020"]
| append
[| makeresults
| eval servername="two",data1="1",data2="2",data3="3",_time="09-02-2020"]
| append
[| makeresults
| eval servername="three",data1="1",data2="20",data3="30",_time="09-02-2020"]
| table servername,data1,data2,data3,_time
| eval uniquefield = servername.data1.data2.data3
| eventstats count by uniquefield
| eval occurence = if(count=1, "single","multiple")
| fields - count, - uniquefield&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 20:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521557#M146985</guid>
      <dc:creator>aa70627</dc:creator>
      <dc:date>2020-09-25T20:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521562#M146988</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/97405"&gt;@aa70627&lt;/a&gt;&amp;nbsp;Good idea although you should probably include a delimiter that doesn't appear in adjacent fields&lt;/P&gt;&lt;P&gt;if data1=12 and data2=345 in one row, and data1=123 and data2=45 you wouldn't be able to distinguish data1.data2 sufficiently&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 21:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521562#M146988</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-25T21:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521591#M146996</link>
      <description>&lt;P&gt;Thanks, this works perfectly fine for my case..&lt;/P&gt;&lt;P&gt;im already coming up with unique values for those fields before i use your solution , so they will be similar in any case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you....&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 07:08:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521591#M146996</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-09-26T07:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Eval field based on similar events or single event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521593#M146997</link>
      <description>&lt;P&gt;data is already unique when the below query is run, so it works perfectly fine for my case...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval uniquefield = servername.data1.data2.data3 | eventstats count by uniquefield | eval occurence = if(count=1, "single","multiple") | fields - count, - uniquefield&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 07:09:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-field-based-on-similar-events-or-single-event/m-p/521593#M146997</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-09-26T07:09:50Z</dc:date>
    </item>
  </channel>
</rss>

