<?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 to get the latest record of each month for each specific column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-record-of-each-month-for-each-specific/m-p/360334#M106515</link>
    <description>&lt;P&gt;You can try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="snow" sourcetype="snow:incident" number="*" state_values="*"
| dedup number state_values
| search state_values!="Resolved"
| timechart span="1mon" count(number) as Count by assignment_group_name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Same should also be achievable by stats followed by timechart.&lt;/P&gt;

&lt;P&gt;PS: If _time does not match with sys_updated_on then you might need to add &lt;CODE&gt;| eval _time=sys_updated_on&lt;/CODE&gt; before timechart or else use chart &lt;STRONG&gt;over sys_updated_on&lt;/STRONG&gt; instead of timechart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart span="1mon" count(number) as Count over sys_updated_on by assignment_group_name 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 13:55:30 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-29T13:55:30Z</dc:date>
    <item>
      <title>How to get the latest record of each month for each specific column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-record-of-each-month-for-each-specific/m-p/360333#M106514</link>
      <description>&lt;P&gt;Dear guys,&lt;BR /&gt;
     I'm very new in Splunk and I got some work task which still have no idea about the solution. Please kindly give some suggestion. &lt;/P&gt;

&lt;P&gt;The purpose of this search is &lt;STRONG&gt;"To track the number of backlog case in each month divided by assignment_group_name"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The number will be count in each assignment_group_name only if the last record of each month was assigned to that assignment group and the state_values of that record must not be "Resolved" &lt;BR /&gt;
In case, there are no record of the current month, program will get the the last record of the last month instead.&lt;/P&gt;

&lt;P&gt;Here is the example of raw data,&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;index="snow" sourcetype="snow:incident" number="INC0079884" OR number="INC0086062"&lt;BR /&gt;
| table number sys_updated_on sys_created_on assignment_group_name state_values&lt;BR /&gt;
|sort number sys_updated_on&lt;/EM&gt;&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/194302-capture.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;The result should be look like this&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/194305-backlog.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-record-of-each-month-for-each-specific/m-p/360333#M106514</guid>
      <dc:creator>urapaveerapan</dc:creator>
      <dc:date>2020-09-29T13:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest record of each month for each specific column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-record-of-each-month-for-each-specific/m-p/360334#M106515</link>
      <description>&lt;P&gt;You can try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="snow" sourcetype="snow:incident" number="*" state_values="*"
| dedup number state_values
| search state_values!="Resolved"
| timechart span="1mon" count(number) as Count by assignment_group_name 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Same should also be achievable by stats followed by timechart.&lt;/P&gt;

&lt;P&gt;PS: If _time does not match with sys_updated_on then you might need to add &lt;CODE&gt;| eval _time=sys_updated_on&lt;/CODE&gt; before timechart or else use chart &lt;STRONG&gt;over sys_updated_on&lt;/STRONG&gt; instead of timechart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart span="1mon" count(number) as Count over sys_updated_on by assignment_group_name 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-record-of-each-month-for-each-specific/m-p/360334#M106515</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T13:55:30Z</dc:date>
    </item>
  </channel>
</rss>

