<?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: First event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486627#M136102</link>
    <description>&lt;P&gt;hi @tahasefiani,&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
| where (strftime(_time, "%Y-%m-%d") &amp;gt;= "2020-02-26") AND (strftime(_time, "%Y-%m-%d") &amp;lt;= "2020-03-03") and STEP=="Click"
| bucket _time span=1d
| stats earliest(_time) as time by MESSAGE 
| eval time=strftime(time, "%Y-%m-%d") 
| where IN(MESSAGE, "337668c2-162c-4f4f-bda9-92f7816f2752", "46095117-4dcb-4ebc-9906-8c23f1a1a26b", "60eb62a4-c54a-4fc0-9aaa-17726ff62929", "8b5e055c-17ab-4135-8b90-1fbc65032792")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Mar 2020 10:45:36 GMT</pubDate>
    <dc:creator>manjunathmeti</dc:creator>
    <dc:date>2020-03-06T10:45:36Z</dc:date>
    <item>
      <title>First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486625#M136100</link>
      <description>&lt;P&gt;Hello, this is my query &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
| where (strftime(_time, "%Y-%m-%d") &amp;gt;= "2020-02-26") AND (strftime(_time, "%Y-%m-%d") &amp;lt;= "2020-03-03") and STEP=="Click"
| bucket _time span=1d
|table _time,MESSAGE
|where MESSAGE = "337668c2-162c-4f4f-bda9-92f7816f2752" OR MESSAGE = "46095117-4dcb-4ebc-9906-8c23f1a1a26b" OR MESSAGE = "60eb62a4-c54a-4fc0-9aaa-17726ff62929" OR MESSAGE = "8b5e055c-17ab-4135-8b90-1fbc65032792"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this is the result &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8492i2AB93391BB791E65/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What i want is only the lines on yellow:&lt;BR /&gt;
If I have a message on the 26th, 27th and 28th I must have that of 26&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 08:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486625#M136100</guid>
      <dc:creator>tahasefiani</dc:creator>
      <dc:date>2020-03-06T08:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486626#M136101</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
 | where (strftime(_time, "%Y-%m-%d") &amp;gt;= "2020-02-26") AND (strftime(_time, "%Y-%m-%d") &amp;lt;= "2020-03-03") and STEP=="Click"
 | bucket _time span=1d
 |stats min(_time) as _time by MESSAGE
 |where MESSAGE = "337668c2-162c-4f4f-bda9-92f7816f2752" OR MESSAGE = "46095117-4dcb-4ebc-9906-8c23f1a1a26b" OR MESSAGE = "60eb62a4-c54a-4fc0-9aaa-17726ff62929" OR MESSAGE = "8b5e055c-17ab-4135-8b90-1fbc65032792"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 10:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486626#M136101</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-06T10:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486627#M136102</link>
      <description>&lt;P&gt;hi @tahasefiani,&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
| where (strftime(_time, "%Y-%m-%d") &amp;gt;= "2020-02-26") AND (strftime(_time, "%Y-%m-%d") &amp;lt;= "2020-03-03") and STEP=="Click"
| bucket _time span=1d
| stats earliest(_time) as time by MESSAGE 
| eval time=strftime(time, "%Y-%m-%d") 
| where IN(MESSAGE, "337668c2-162c-4f4f-bda9-92f7816f2752", "46095117-4dcb-4ebc-9906-8c23f1a1a26b", "60eb62a4-c54a-4fc0-9aaa-17726ff62929", "8b5e055c-17ab-4135-8b90-1fbc65032792")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 10:45:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486627#M136102</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-06T10:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486628#M136103</link>
      <description>&lt;P&gt;Hi, @manjunathmeti&lt;BR /&gt;
I like &lt;CODE&gt;min()&lt;/CODE&gt; to epoch. your &lt;CODE&gt;IN&lt;/CODE&gt; usage is cool.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 11:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486628#M136103</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-06T11:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486629#M136104</link>
      <description>&lt;P&gt;I have an old version,so i can't use IN&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 13:21:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486629#M136104</guid>
      <dc:creator>tahasefiani</dc:creator>
      <dc:date>2020-03-06T13:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486630#M136105</link>
      <description>&lt;P&gt;@to4kawa @manjunathmeti for the two solution, i can't use after a timechart? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;dc(ID_MESSAGE) by _time

OR

timechart dc(ID_MESSAGE)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 13:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486630#M136105</guid>
      <dc:creator>tahasefiani</dc:creator>
      <dc:date>2020-03-06T13:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486631#M136106</link>
      <description>&lt;P&gt;How old? &lt;CODE&gt;IN&lt;/CODE&gt; has worked since at least 6.3&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 14:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486631#M136106</guid>
      <dc:creator>wmyersas</dc:creator>
      <dc:date>2020-03-06T14:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486632#M136107</link>
      <description>&lt;P&gt;&lt;CODE&gt;timechart&lt;/CODE&gt; ? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....
| bucket _time span=1d
| table _time,MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is same of &lt;CODE&gt;timechart&lt;/CODE&gt; result.&lt;/P&gt;

&lt;P&gt;but where does &lt;CODE&gt;dc()&lt;/CODE&gt; come from? &lt;BR /&gt;
your question &lt;EM&gt;First event&lt;/EM&gt; doesn't need &lt;CODE&gt;dc()&lt;/CODE&gt; and &lt;CODE&gt;timechart&lt;/CODE&gt; .&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 14:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486632#M136107</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-06T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486633#M136108</link>
      <description>&lt;P&gt;the purpose of the query, at the base is to calculate the messages per day, and count  the message only on the first day.This why i did this query.&lt;/P&gt;

&lt;P&gt;Now, i have 3 ID_MESSAGE for 27/02 and one for 28/02&lt;/P&gt;

&lt;P&gt;This is what i want :&lt;/P&gt;

&lt;P&gt;27/02 =&amp;gt; 3&lt;BR /&gt;
28/02 =&amp;gt; 1&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
| where (strftime(_time, "%Y-%m-%d") &amp;gt;= "2020-02-26") AND (strftime(_time, "%Y-%m-%d") &amp;lt;= "2020-03-03") and STEP=="Click"
| bucket _time span=1d
| stats earliest(_time) as _time by ID_MESSAGE
| eval _time=strftime(_time, "%Y-%m-%d") 
|timechart count(ID_MESSAGE)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 14:49:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486633#M136108</guid>
      <dc:creator>tahasefiani</dc:creator>
      <dc:date>2020-03-06T14:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486634#M136109</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
| rename COMMENT AS "Use timepicker to filter dates"
| addinfo
| rename COMMENT AS "First problem here: you used 'and' instead of 'AND'"
| where (_time &amp;gt;= info_min_time) AND (_time &amp;lt;= info_max_time)  AND STEP=="Click"
| bucket _time span=1d
| sort 0 - _time
| streamstats count AS _serial BY MESSAGE _time
| where _serial="1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or maybe even this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| loadjob savedsearch="myquery"
| rename COMMENT AS "Use timepicker to filter dates"
| addinfo
| rename COMMENT AS "First problem here: you used 'and' instead of 'AND'"
| where (_time &amp;gt;= info_min_time) AND (_time &amp;lt;= info_max_time)  AND STEP=="Click"
| timechart span=1d first(_time) AS time BY MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 15:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486634#M136109</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-06T15:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: First event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486635#M136110</link>
      <description>&lt;P&gt;this query works for me &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | loadjob savedsearch="myquery"
 | where (strftime(_time, "%Y-%m-%d") &amp;gt;= "2020-02-26") AND (strftime(_time, "%Y-%m-%d") &amp;lt;= "2020-03-03") and STEP=="Click"
 | bucket _time span=1d
 | stats earliest(_time) as _time by ID_MESSAGE
 | eval _time=strftime(_time, "%Y-%m-%d") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this is the result : &lt;/P&gt;

&lt;P&gt;_time       ID_MESSAGE&lt;BR /&gt;
27/02       YHDD&lt;BR /&gt;
27/02       MFJIO&lt;BR /&gt;
27/02       LKCFD&lt;BR /&gt;
28/02       LMDFF&lt;/P&gt;

&lt;P&gt;Now i wanna count ID_MESSAGE by _time to have this :&lt;/P&gt;

&lt;P&gt;_time       count(ID_MESSAGE)&lt;BR /&gt;
27/02       3&lt;BR /&gt;
28/02       1&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/First-event/m-p/486635#M136110</guid>
      <dc:creator>tahasefiani</dc:creator>
      <dc:date>2020-09-30T04:31:46Z</dc:date>
    </item>
  </channel>
</rss>

