<?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: Query for scenario with status change in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271508#M176772</link>
    <description>&lt;P&gt;For cumulative results, add &lt;CODE&gt;accum count&lt;/CODE&gt; to the end&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2016 00:44:24 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-09-12T00:44:24Z</dc:date>
    <item>
      <title>Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271502#M176766</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have  a scenario where an entity when enrolled has many status i.e.&lt;/P&gt;

&lt;P&gt;EntityName   Date              Status&lt;BR /&gt;
Entity1          01-03-2016     In Progress&lt;BR /&gt;
Entity1          21-03-2016      Active&lt;BR /&gt;
Entity1          04-04-2016      Blocked&lt;BR /&gt;
Entity1          05-04-2016      Inactive&lt;BR /&gt;
Entity1          10-05-2016      Active&lt;/P&gt;

&lt;P&gt;I need to create column chart with time on x axis (mm/yyyy) format and y axis as status. Separate charts for all status, for example status is active then the chart should show for active scenario 1 as count for 05/2016 and for all other scenarios it should show zero.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 12:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271502#M176766</guid>
      <dc:creator>sidhantbhayana</dc:creator>
      <dc:date>2016-09-09T12:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271503#M176767</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | chart count over Date by Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 13:07:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271503#M176767</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-09T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271504#M176768</link>
      <description>&lt;P&gt;Hi Sundareshr&lt;/P&gt;

&lt;P&gt;We have to show monthly trend, so one entity may be active in one month and might get inactive next month due to inactivity.&lt;/P&gt;

&lt;P&gt;Active Entity Changes by Month is the actual requirement, if an entity is was active in 03/16 and it became inactive in 04/16 and then again in the same month it got active so our chart should display the data only for Final status as active in the month of april. Similarly, other entity has a status in the below fashion &lt;/P&gt;

&lt;P&gt;05/16 E2 P&lt;BR /&gt;
05/16 E2 A&lt;BR /&gt;
06/16 E2 I&lt;/P&gt;

&lt;P&gt;Here it should show Inactive entity changes by month in the month of june and in active it should not display in that month.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 17:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271504#M176768</guid>
      <dc:creator>sidhantbhayana</dc:creator>
      <dc:date>2016-09-09T17:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271505#M176769</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval date=strptime(date, "%d-%m-%Y") | sort - date | eval date=strftime(date, "%m-%Y") | dedup date | chart count over date by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2016 17:56:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271505#M176769</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-09T17:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271506#M176770</link>
      <description>&lt;P&gt;Hi Sundareshr &lt;BR /&gt;
I am using this logic currently but when we check for total active entities and compare with this query there is a difference of two or three entites. &lt;BR /&gt;
eval Date = strftime ("_time","%Y/%m")| stats last (_time) as&amp;nbsp; _time last (status) as status by entityId l, Date|eventstats&amp;nbsp; first (Date) as Date1by entityId|streamstats first (status)&amp;nbsp; as statusnew by entityId window=2 | eval status1 = case (&amp;nbsp; (Date1=Date AND status=A),1,(Date1!=Date AND status1!=statusnew AND status=A),1,(Date!=Date AND status1!=statusnew),-1,(Date1!=Date AND status=statusnew),0,(Date1=Date AND status=I) OR (Date1=Date AND status=P) ,0, (Date1!=Date AND status=P) OR ( Date1!=Date AND status=I) ,0))|timechart span=mon sum(status1) as Active|accum Active&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271506#M176770</guid>
      <dc:creator>sidhantbhayana</dc:creator>
      <dc:date>2020-09-29T10:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271507#M176771</link>
      <description>&lt;P&gt;also we need to show a cumulative result at the end.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2016 16:25:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271507#M176771</guid>
      <dc:creator>sidhantbhayana</dc:creator>
      <dc:date>2016-09-11T16:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Query for scenario with status change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271508#M176772</link>
      <description>&lt;P&gt;For cumulative results, add &lt;CODE&gt;accum count&lt;/CODE&gt; to the end&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2016 00:44:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-for-scenario-with-status-change/m-p/271508#M176772</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-12T00:44:24Z</dc:date>
    </item>
  </channel>
</rss>

