<?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: How do you retrieve the number of days from the date field? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403489#M26435</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health")|dedup _time,CaseNumber|where Created_ON=Updated_ON| eval days = (Now() - _time) /86400| eval days_ago = case(days &amp;lt;90 AND days &amp;gt; 60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day")| chart count by days_ago,Group|sort days_ago&lt;/P&gt;

&lt;P&gt;most cases have both (Group="Data/Config" OR Group="Secure").&lt;BR /&gt;
initially (Group is "Data/Config") then after some time it change to (Group="Secure").when i count by group,it is showing initial Group name for that case.it is not showing to current group.&lt;/P&gt;

&lt;P&gt;i want to display count by group with latest group name(i.e case that have latest group that comes under particular group not previous group)&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:24:56 GMT</pubDate>
    <dc:creator>ramesh12345</dc:creator>
    <dc:date>2020-09-29T23:24:56Z</dc:date>
    <item>
      <title>How do you retrieve the number of days from the date field?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403486#M26432</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sh" sourcetype="xml" status=* (Group="Connect" OR Group="health") AND (Section="Site" OR Section="Local") AND (Component="test" OR Component="test1")|dedup _time,Case|where Created_ON=Updated_ON|table _time,Cretaed_ON,Updated_ON
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want a bar graph based on the Group wise trend weekly wise for the last 3 months.&lt;/P&gt;

&lt;P&gt;bar should display for sameday(current day cases creation),1-2 days(within 2 days creation),(2-5 days),(5-7 days) like this in x axis&lt;BR /&gt;
different colors showing different groups.&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/6593i703E0F3BC922CDB4/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;How do you do this? Please help how to form the query&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 15:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403486#M26432</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-20T15:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve the number of days from the date field?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403487#M26433</link>
      <description>&lt;P&gt;You will need to create a calculated field that tells you how many days ago the event occurred and then use the charts command to aggregate on the days_ago field that you have created and the field you would like to split your series. Here is an example using the internal logs where I split by the log_level field.&lt;/P&gt;

&lt;P&gt;index=_internal sourcetype=splunkd&lt;BR /&gt;
| eval days = (Now() - _time) /86400&lt;BR /&gt;
| eval days_ago = case(days &amp;gt; 5, "5+ days", days &amp;lt; 5 AND days &amp;gt; 3, "3-5 days", days &amp;lt; 3 AND days &amp;gt; 1, "1-3 Days", days &amp;lt; 1, "Less than 1 Day")&lt;BR /&gt;
| chart count by days_ago log_level&lt;/P&gt;

&lt;P&gt;Then click on the visualization tab &amp;gt; format &amp;gt; general  and select "stacked" for stack mode&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/269589-screen-shot-2019-02-20-at-22219-pm.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:18:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403487#M26433</guid>
      <dc:creator>pkeenan87</dc:creator>
      <dc:date>2020-09-29T23:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve the number of days from the date field?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403488#M26434</link>
      <description>&lt;P&gt;It's working fine as per my requirement.Thank u very much.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 09:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403488#M26434</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-21T09:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve the number of days from the date field?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403489#M26435</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;index="os" sourcetype="Service" status=* (Group="Data/Config" OR Group="Secure") AND (Section="Site Problem" OR Section="Local health") AND (Component="connectivity" OR Component="health")|dedup _time,CaseNumber|where Created_ON=Updated_ON| eval days = (Now() - _time) /86400| eval days_ago = case(days &amp;lt;90 AND days &amp;gt; 60, "2-3months",days&amp;lt; 60 AND days &amp;gt; 30, "1-2 months",days&amp;lt; 28 AND days &amp;gt; 14, "2-4 weeks",days&amp;lt; 14 AND days &amp;gt; 7, "1-2 weeks",days&amp;lt; 7 AND days &amp;gt; 5, "5-7days", days &amp;lt; 5 AND days &amp;gt; 2, "2-5 days", days &amp;lt; 2 AND days &amp;gt; 1, "2 Days", days &amp;lt; 1, "Less than 1 Day")| chart count by days_ago,Group|sort days_ago&lt;/P&gt;

&lt;P&gt;most cases have both (Group="Data/Config" OR Group="Secure").&lt;BR /&gt;
initially (Group is "Data/Config") then after some time it change to (Group="Secure").when i count by group,it is showing initial Group name for that case.it is not showing to current group.&lt;/P&gt;

&lt;P&gt;i want to display count by group with latest group name(i.e case that have latest group that comes under particular group not previous group)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:24:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403489#M26435</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do you retrieve the number of days from the date field?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403490#M26436</link>
      <description>&lt;P&gt;&lt;STRONG&gt;reltime&lt;/STRONG&gt; is the command available to get "The number of hours/days" from the _time field.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.2001/SearchReference/Reltime#Examples"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.0.2001/SearchReference/Reltime#Examples&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 12:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-retrieve-the-number-of-days-from-the-date-field/m-p/403490#M26436</guid>
      <dc:creator>maniu1609</dc:creator>
      <dc:date>2020-03-11T12:46:47Z</dc:date>
    </item>
  </channel>
</rss>

