<?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: Help with search for week event analysis in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620235#M215600</link>
    <description>&lt;P&gt;First thing you need to consider is how to define release boundary. &amp;nbsp;As I examined previously, your best bet is to use a lookup to determine which data belongs to which release because it is not easy to specify on search line. (You can also hard code "release" in a macro. &amp;nbsp;But that's a lot more work than lookup.) &amp;nbsp;In most cases, number of days or weeks will not give you the correct boundaries.&lt;/P&gt;&lt;P&gt;Here, I'll use hard coded definition&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval release_0_start = strptime("2022-10-16", "%F"),
 release_1_start = strptime("2022-10-30", "%F"),
 release_2_start = strftime("2022-11-13", "%F")
| eval release = case(release_0_start &amp;lt; _time AND _time &amp;lt;= release_1_start, "release 1",
 release_1_start &amp;lt; _time AND _time &amp;lt;= release_2_start, "release_2",
 true(), "other")&lt;/LI-CODE&gt;&lt;P&gt;Given today's date, "release_0" is equivalent to "previous release", "release_1" is equivalent to "current release", and "release_2" will be the next release.&lt;/P&gt;&lt;P&gt;Using these definitions, your first panel would be something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest="10/16/2022:00:00:00" latest="10/30/2022:00:00:00"
| extraction, reporting, etc...&lt;/LI-CODE&gt;&lt;P&gt;The second panel, new errors in release_1, can be derived from&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest="10/16/2022:00:00:00" latest=now() 
| rex "Error\s(?&amp;lt;Message&amp;gt;.+)MulesoftAdyenNotification" | rex "fetchSeoContent\(\)\s(?&amp;lt;Exception&amp;gt;.+)" 
| rex "Error:(?&amp;lt;Error2&amp;gt;.+)" 
| rex "(?&amp;lt;ErrorM&amp;gt;Error in template script)+" 
| rex "(?ms)^(?:[^\\|\\n]*\\|){3}(?P&amp;lt;Component&amp;gt;[^\\|]+)" 
| rex "service=(?&amp;lt;Service&amp;gt;[A-Za-z._]+)" 
| rex "Sites-(?&amp;lt;Country&amp;gt;[A-Z]{2})"
| eval Error_Exception= coalesce(Message,Error2,Exception,ErrorM)
| eval release_0_start = strptime("2022-10-16", "%F"),
 release_1_start = strptime("2022-10-30", "%F"),
 release_2_start = strftime("2022-11-13", "%F")
| eval release = case(release_0_start &amp;lt; _time AND _time &amp;lt;= release_1_start, "release 1",
 release_1_start &amp;lt; _time AND _time &amp;lt;= release_2_start, "release_2",
 true(), "other")
 ``` by this line, each event will have the artificially marked release ```
| stats count by Error_Exception release
| eventstats values(release) by Error_Exception
| where mvcount('values(release)') == 1 AND release == "release_1"
| fields count Error_Exception ``` this lists errors in release_1 only ```&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 09 Nov 2022 08:56:00 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-11-09T08:56:00Z</dc:date>
    <item>
      <title>Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/618359#M214912</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;
&lt;P&gt;I have used to ask the same question in my previous ask :&lt;BR /&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-compare-two-weeks-errors-and-highlight/m-p/617827#M214708" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-compare-two-weeks-errors-and-highlight/m-p/617827#M214708&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I am not having the correct results while using the suggested workaround in SPL. So I have modified my SPL as below. Here my release is for 14 days and I need to compare the events with &lt;STRONG&gt;"Current_release_error" &amp;amp; "Last_release_error".&amp;nbsp;&lt;/STRONG&gt;If any new error only present in current release then I want to call out those results. Pease suggest some value workarounds.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest=-14d latest=now() 
| rex "Error\s(?&amp;lt;Message&amp;gt;.+)MulesoftAdyenNotification" | rex "fetchSeoContent\(\)\s(?&amp;lt;Exception&amp;gt;.+)" 
| rex "Error:(?&amp;lt;Error2&amp;gt;.+)" 
| rex "(?&amp;lt;ErrorM&amp;gt;Error in template script)+" 
| rex "(?ms)^(?:[^\\|\\n]*\\|){3}(?P&amp;lt;Component&amp;gt;[^\\|]+)" 
| rex "service=(?&amp;lt;Service&amp;gt;[A-Za-z._]+)" 
| rex "Sites-(?&amp;lt;Country&amp;gt;[A-Z]{2})" | eval Error_Exception= coalesce(Message,Error2,Exception,ErrorM)
| eval Week=case(_time&amp;lt;relative_time(now(),"-14d@d"),"Current_release_error",_time&amp;gt;relative_time(now(),"-28d@d-14d@d"),"Last_release_error")
| stats dc(Week) AS Week_count values(Week) AS Week BY Error_Exception
| eval Week=if(Week_count=2,"Present in Previous Release",Week)
| where Week_count=1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 14:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/618359#M214912</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-10-26T14:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/619792#M215401</link>
      <description>&lt;P&gt;You really need to explain what "&lt;SPAN&gt;not having the correct results" really means with illustration of your data (anonymize as needed), and the output you get plus the SPL attempted. &amp;nbsp;In the previous post,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;gave the correct answer for discerning new errors by week in a two-week period. &amp;nbsp;Here, you are asking for new errors by release, where release is defined as a two-week period. &amp;nbsp;But your search window is limited to two weeks (earliest=-14d). &amp;nbsp;Could this be the reason why you cannot find new errors? &amp;nbsp;Effectively, this eval&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Week=case(_time&amp;lt;relative_time(now(),"-14d@d"),"Current_release_error",_time&amp;gt;relative_time(now(),"-28d@d-14d@d"),"Last_release_error")&lt;/LI-CODE&gt;&lt;P&gt;will always return&amp;nbsp;"Current_release_error" because you only have 14 days of data to work with due to&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="andale mono,times"&gt;earliest=-14d&lt;/FONT&gt;. &amp;nbsp;You may get more sensible result if your first search command&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest=-28d@d latest=-0d@d &lt;/LI-CODE&gt;&lt;P&gt;Even so, your last where command is not restrictive enough. &amp;nbsp;In gcuello's code, there is an additional condition,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where Week == "Last_release_error" AND Week_count == 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This said, you must have also realized that working with "release" is fundamentally different from working with calendar week, and working with calendar week is different from working with 7-day periods. &amp;nbsp;Release is a local business construct that is not merely a 14-day period. &amp;nbsp;It starts and ends at fixed calendar dates. &amp;nbsp;In other words, events that happened less than 14 days ago could belong to the previous release. (Unless you only run this search at the end of each release.) &amp;nbsp; When I work with such a local construct, I resort to lookup. &amp;nbsp;I.e., enter the start and end dates of each release into a lookup table, then calculate based on lookup output.&lt;/P&gt;&lt;P&gt;If you must calculate "release" without lookup, use absolute dates such as earliest="10/12/2022:00:00:00", and calculate that "Week" based on absolute dates, too.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 01:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/619792#M215401</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-11-07T01:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/619797#M215402</link>
      <description>&lt;P&gt;Your search is for only 14 days, so your Week=case... statement is meaningless, do you mean&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest=-28d latest=now() 
| rex "Error\s(?&amp;lt;Message&amp;gt;.+)MulesoftAdyenNotification" | rex "fetchSeoContent\(\)\s(?&amp;lt;Exception&amp;gt;.+)" 
| rex "Error:(?&amp;lt;Error2&amp;gt;.+)" 
| rex "(?&amp;lt;ErrorM&amp;gt;Error in template script)+" 
| rex "(?ms)^(?:[^\\|\\n]*\\|){3}(?P&amp;lt;Component&amp;gt;[^\\|]+)" 
| rex "service=(?&amp;lt;Service&amp;gt;[A-Za-z._]+)" 
| rex "Sites-(?&amp;lt;Country&amp;gt;[A-Z]{2})" | eval Error_Exception= coalesce(Message,Error2,Exception,ErrorM)
| eval Week=if(_time&amp;lt;relative_time(now(),"-14d@d"), "Last_release_error", "Current_release_error")
| stats dc(Week) AS Week_count values(Week) AS Week BY Error_Exception
| eval Week=if(Week_count=2,"Present in Previous Release",Week)
| where Week_count=1&lt;/LI-CODE&gt;&lt;P&gt;i.e. I updated the earliest range to be 28d and the Week/case is changed.&lt;/P&gt;&lt;P&gt;Note that your first time test for _time LESS THAN relative_time(now(), "-14d@d" was set as "Current" week, but if it is LESS than, it would be OLDER, so previous release.&lt;/P&gt;&lt;P&gt;Not sure if this will fix your issues though&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 04:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/619797#M215402</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-11-07T04:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620215#M215588</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp; let me concise and avoid the confusion.&lt;/P&gt;&lt;P&gt;Take an example :&lt;/P&gt;&lt;P&gt;I need two panel , in first panel i want to all the errors in last release ( 14 days is the release period ). And new release start just after the last release end. So in second panel which is current release,&amp;nbsp; i want to highlight the new error by comparing the last release errors. So how i compare two panel results and highlights the new errors.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 04:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620215#M215588</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-11-09T04:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620235#M215600</link>
      <description>&lt;P&gt;First thing you need to consider is how to define release boundary. &amp;nbsp;As I examined previously, your best bet is to use a lookup to determine which data belongs to which release because it is not easy to specify on search line. (You can also hard code "release" in a macro. &amp;nbsp;But that's a lot more work than lookup.) &amp;nbsp;In most cases, number of days or weeks will not give you the correct boundaries.&lt;/P&gt;&lt;P&gt;Here, I'll use hard coded definition&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval release_0_start = strptime("2022-10-16", "%F"),
 release_1_start = strptime("2022-10-30", "%F"),
 release_2_start = strftime("2022-11-13", "%F")
| eval release = case(release_0_start &amp;lt; _time AND _time &amp;lt;= release_1_start, "release 1",
 release_1_start &amp;lt; _time AND _time &amp;lt;= release_2_start, "release_2",
 true(), "other")&lt;/LI-CODE&gt;&lt;P&gt;Given today's date, "release_0" is equivalent to "previous release", "release_1" is equivalent to "current release", and "release_2" will be the next release.&lt;/P&gt;&lt;P&gt;Using these definitions, your first panel would be something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest="10/16/2022:00:00:00" latest="10/30/2022:00:00:00"
| extraction, reporting, etc...&lt;/LI-CODE&gt;&lt;P&gt;The second panel, new errors in release_1, can be derived from&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="ABC" source="/abc.log" ("ERROR" OR "EXCEPTION") earliest="10/16/2022:00:00:00" latest=now() 
| rex "Error\s(?&amp;lt;Message&amp;gt;.+)MulesoftAdyenNotification" | rex "fetchSeoContent\(\)\s(?&amp;lt;Exception&amp;gt;.+)" 
| rex "Error:(?&amp;lt;Error2&amp;gt;.+)" 
| rex "(?&amp;lt;ErrorM&amp;gt;Error in template script)+" 
| rex "(?ms)^(?:[^\\|\\n]*\\|){3}(?P&amp;lt;Component&amp;gt;[^\\|]+)" 
| rex "service=(?&amp;lt;Service&amp;gt;[A-Za-z._]+)" 
| rex "Sites-(?&amp;lt;Country&amp;gt;[A-Z]{2})"
| eval Error_Exception= coalesce(Message,Error2,Exception,ErrorM)
| eval release_0_start = strptime("2022-10-16", "%F"),
 release_1_start = strptime("2022-10-30", "%F"),
 release_2_start = strftime("2022-11-13", "%F")
| eval release = case(release_0_start &amp;lt; _time AND _time &amp;lt;= release_1_start, "release 1",
 release_1_start &amp;lt; _time AND _time &amp;lt;= release_2_start, "release_2",
 true(), "other")
 ``` by this line, each event will have the artificially marked release ```
| stats count by Error_Exception release
| eventstats values(release) by Error_Exception
| where mvcount('values(release)') == 1 AND release == "release_1"
| fields count Error_Exception ``` this lists errors in release_1 only ```&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Nov 2022 08:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620235#M215600</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-11-09T08:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620530#M215716</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;Yes You are true we can't harcode the baseline time for Post and Pre release date. So to overcome from this issue I have used two different panel. 1st panel is the Pre release &amp;amp; 2nd is the post release. As I need to compare both panels events and identify any new errors occur in Post release. Please Provide your expert suggestion.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I have used below codes but it is taking so much time to populate the results and its impacts on my search environment in Splunk.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 04:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620530#M215716</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-11-11T04:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search for week event analysis</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620532#M215717</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;Sorry forgot to attach the screenshot. With continue my comment.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uagraw01_0-1668143046708.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22441i59D098247C171680/image-size/medium?v=v2&amp;amp;px=400" role="button" title="uagraw01_0-1668143046708.png" alt="uagraw01_0-1668143046708.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 04:57:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-for-week-event-analysis/m-p/620532#M215717</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2022-11-11T04:57:43Z</dc:date>
    </item>
  </channel>
</rss>

