<?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: chart by date ignoring year in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673160#M230515</link>
    <description>&lt;P&gt;Hi, is it possible to change the date format to YYYY-MM-DD and then something like this?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart sum(sats) over team by Date useother=false
| sort 13 Date&lt;/LI-CODE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jan 2024 17:08:11 GMT</pubDate>
    <dc:creator>madhav_dholakia</dc:creator>
    <dc:date>2024-01-03T17:08:11Z</dc:date>
    <item>
      <title>chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673155#M230513</link>
      <description>&lt;P&gt;Im using the search below and basically want a chart showing last 12 dates going oldest to newest from left to right by date.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup running_data.csv
| eval EP=strptime(Date, "%m/%d/%Y")
| eval Date=strftime(EP, "%m/%d/%Y")
| chart sum(sats) over team by Date useother=false limit=12
| fillnull value=0&lt;/LI-CODE&gt;
&lt;P&gt;The search was working fine up until January and year change, now the search only shows the last date in December and is missing the newest&amp;nbsp; 01/02/2024 date.&amp;nbsp; If I change the limit to be large enough to include all date entries in the csv file, I discovered the below:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk chart by date example.png" style="width: 842px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28742i849AE900E2D323A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunk chart by date example.png" alt="splunk chart by date example.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Its putting the 01/02/2024 date before the oldest date in the csv, instead of putting that 01/02/2024 column after the 12/18/2023 date column.&amp;nbsp; So its like its ignoring the year and going by month chronologically. Done quite a bit of searching on this to no avail, and seems like this should be an easy thing to do... Im not opposed to not using "chart" if someone has a better way.&amp;nbsp; Ideally the search returns the last 12 dates from oldest to newest in the columns and then the team name and numbers sats on that date in the rows.&amp;nbsp; Thansk for any suggestions!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 17:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673155#M230513</guid>
      <dc:creator>jyates76</dc:creator>
      <dc:date>2024-01-03T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673160#M230515</link>
      <description>&lt;P&gt;Hi, is it possible to change the date format to YYYY-MM-DD and then something like this?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart sum(sats) over team by Date useother=false
| sort 13 Date&lt;/LI-CODE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 17:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673160#M230515</guid>
      <dc:creator>madhav_dholakia</dc:creator>
      <dc:date>2024-01-03T17:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673162#M230516</link>
      <description>&lt;P&gt;I think doing something like this should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup running_data.csv
    | eval
        EP=strptime(Date, "%m/%d/%Y")
    | chart
        sum(sats) as sats
            over EP
            by team
    | sort 0 +EP
    | eval
        Date=strftime(EP, "%m/%d/%Y")
    | fields - EP
    | transpose 25 header_field=Date
    | rename
        column as team&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will first sort the dates while they are in epoch time and then we convert to human readable timestamps. Then, a transpose is used to retain the order of ascending time from left to right in the header.&lt;BR /&gt;Screenshot of local example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_0-1704301832167.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28747i0372846C1DBDE4DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_0-1704301832167.png" alt="dtburrows3_0-1704301832167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 17:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673162#M230516</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2024-01-03T17:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673171#M230522</link>
      <description>&lt;P&gt;Thanks, this actually is close with some tweaking but I still cant get around the fact that after the transpose, I want it show the latest 12... Transpose 25 for example will get me the first 25 dates left to right and I want the last 12 right to left if that makes sense?&amp;nbsp; &amp;nbsp; I could do Transpose with no integer to show everything, but then that would be an extremely wide table as this data grows over time on a weekly basis we get a new date, and on those dates we are trying to show number of sats per team for all teams on that date.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 20:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673171#M230522</guid>
      <dc:creator>jyates76</dc:creator>
      <dc:date>2024-01-03T20:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673173#M230523</link>
      <description>&lt;P&gt;I think transforming the data in a normal Splunk timechart format then doing a head 12 and then transposing should do what you are asking.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup running_data.csv
    | eval
        _time=strptime(Date, "%m/%d/%Y")
    | sort 0 -_time
    | timechart span=1d
        sum(sats) as sats
            by team
    | head 12
    | eval
        Date=strftime(_time, "%m/%d/%Y")
    | fields - _*
    | transpose 12 header_field=Date
    | rename
        column as team&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example output:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_0-1704314762608.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28748iAECDF1DCB84DA86A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_0-1704314762608.png" alt="dtburrows3_0-1704314762608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 20:48:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673173#M230523</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2024-01-03T20:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673176#M230525</link>
      <description>&lt;P&gt;Wait a second. What's the point of doing strptime/strftime over the same value with the same format?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 21:02:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673176#M230525</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-03T21:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673177#M230526</link>
      <description>&lt;P&gt;My assumption is that we are stripping off HH:MM:SS from the original value of Date, but we still want the final results to be in a formatted %m/%d/%Y.&lt;BR /&gt;&lt;BR /&gt;Hard to say for sure without seeing the original dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 21:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673177#M230526</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2024-01-03T21:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673178#M230527</link>
      <description>&lt;P&gt;For that it would be easier to just cut the date after space. Also working with string-formatted timestamps is just asking for trouble.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 21:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673178#M230527</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-03T21:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: chart by date ignoring year</title>
      <link>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673219#M230536</link>
      <description>&lt;P&gt;close enough.. I got it down to showing it dates and what I needed in correct order but from right to left using the below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup running_data.csv
| eval _time=strptime(Date, "%m/%d/%Y")
| sort 0 -_time
| timechart span=1d sum(sats) as sats by team useother=false limit=0
| fillnull value=0
| tail 12
| eval Date=strftime(_time, "%m/%d/%Y")
| fields - _*
| transpose 12 header_field=Date
| rename column as team&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jyates76_0-1704376606477.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28756iBE162E4D0DC76DFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="jyates76_0-1704376606477.png" alt="jyates76_0-1704376606477.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 15:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/chart-by-date-ignoring-year/m-p/673219#M230536</guid>
      <dc:creator>jyates76</dc:creator>
      <dc:date>2024-01-04T15:08:23Z</dc:date>
    </item>
  </channel>
</rss>

