<?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: Dashboard converting strings into dates in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619837#M50894</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250433"&gt;@bTonyC&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;In my Splunk I have a correct display:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Month
2022-1
2022-1
2022-7
2022-7
2022-7
2022-8
2022-9
2022-9
2022-9
2022-10
2022-10
2022-10
2022-10
2022-9"
| stats count by Month 
| eval Month=Month."-01"
| eval Month=strptime(Month, "%Y-%m-%d")
| sort Month
| eval Month=strftime(Month, "%Y-%m")&lt;/LI-CODE&gt;&lt;P&gt;if one answer solves your need, please accept one answer for the other people of Community or tell me how we can help you.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2022 10:30:09 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-11-07T10:30:09Z</dc:date>
    <item>
      <title>Why is my Dashboard converting strings into dates?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619789#M50888</link>
      <description>&lt;P&gt;I use some strings in data to represent months. eg "2022-1"&lt;/P&gt;
&lt;P&gt;Run this in Search:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;| makeresults format=csv data="Month
2022-1
2022-1
2022-7
2022-7
2022-7
2022-8
2022-9
2022-9
2022-9
2022-10
2022-10
2022-10
2022-10
2022-9"
| stats count by Month | sort Month&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-11-07 at 10.43.39 am.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22359iE5EAA373034603FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-11-07 at 10.43.39 am.png" alt="Screen Shot 2022-11-07 at 10.43.39 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now use the Splunk query in Dashboard Studio for a Bar Chart:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-11-07 at 10.45.28 am.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22360i27A161507544BC19/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-11-07 at 10.45.28 am.png" alt="Screen Shot 2022-11-07 at 10.45.28 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Why is October ("2022-10") being treated as a date suddenly????&lt;/P&gt;
&lt;P&gt;Is this Bug or a Feature?&lt;/P&gt;
&lt;P&gt;I tried changing the strings to have a leading Zero for the month. eg. "2022-01"&lt;/P&gt;
&lt;P&gt;They are ALL then treated as Dates. How do I avoid this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-11-07 at 10.48.30 am.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22361i3A0B23118B534BBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-11-07 at 10.48.30 am.png" alt="Screen Shot 2022-11-07 at 10.48.30 am.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619789#M50888</guid>
      <dc:creator>bTonyC</dc:creator>
      <dc:date>2022-11-08T15:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard converting strings into dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619805#M50890</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250433"&gt;@bTonyC&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;because your dates are converted in strings so 2022-10 is before 2022-2.&lt;/P&gt;&lt;P&gt;to have the correct sort, you have to work in epochtime to sort and then again in human readable for presenting or use two digits for all months (2022-01).&lt;/P&gt;&lt;P&gt;Anyway, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Month
2022-1
2022-1
2022-7
2022-7
2022-7
2022-8
2022-9
2022-9
2022-9
2022-10
2022-10
2022-10
2022-10
2022-9"
| stats count by Month 
| eval Month=Month."-01"
| eval Month=strptime(Month, "%Y-%m-%d")
| sort Month
| eval Month=strftime(Month, "%Y-%m&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 07:29:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619805#M50890</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-07T07:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard converting strings into dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619817#M50891</link>
      <description>&lt;P&gt;Thanks Giuseppe,&lt;BR /&gt;I ended up doing something very similar to get the ordering correct.&lt;BR /&gt;(Convert string to a date then back to a string for display)&lt;/P&gt;&lt;P&gt;Any idea why October displays as a full dates when they are all just strings "2022-10"???&lt;/P&gt;&lt;P&gt;Further experimenting shows that the hyphen is the trigger. If I use another character, this problem doesn't happen. eg. "2022&amp;gt;10"&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Tony&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 08:31:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619817#M50891</guid>
      <dc:creator>bTonyC</dc:creator>
      <dc:date>2022-11-07T08:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard converting strings into dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619837#M50894</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250433"&gt;@bTonyC&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;In my Splunk I have a correct display:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Month
2022-1
2022-1
2022-7
2022-7
2022-7
2022-8
2022-9
2022-9
2022-9
2022-10
2022-10
2022-10
2022-10
2022-9"
| stats count by Month 
| eval Month=Month."-01"
| eval Month=strptime(Month, "%Y-%m-%d")
| sort Month
| eval Month=strftime(Month, "%Y-%m")&lt;/LI-CODE&gt;&lt;P&gt;if one answer solves your need, please accept one answer for the other people of Community or tell me how we can help you.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 10:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/619837#M50894</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-07T10:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard converting strings into dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/620033#M50908</link>
      <description>&lt;P&gt;Thanks again Giuseppe!!&lt;/P&gt;&lt;P&gt;I agree that Month is displayed correctly in Splunk Search.&lt;/P&gt;&lt;P&gt;The issue appears when using a chart visualisation in Splunk Dashboard Studio.&lt;BR /&gt;(See my previous screenshots to see what I mean)&lt;/P&gt;&lt;P&gt;Dashboard Studio charts seem to convert "2022-10" into a Date/time and displays that.&lt;/P&gt;&lt;P&gt;This is the core issue.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Tony&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 04:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/620033#M50908</guid>
      <dc:creator>bTonyC</dc:creator>
      <dc:date>2022-11-08T04:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard converting strings into dates</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/620055#M50910</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250433"&gt;@bTonyC&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry, I didn't tried with Dashboard Studio, and this situation is one or the reasons because I never started to use it!&lt;/P&gt;&lt;P&gt;maybe you could try to add also the day in your date (2022-11-01) so Dashboard Studio will not change your output.&lt;/P&gt;&lt;P&gt;ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 07:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-my-Dashboard-converting-strings-into-dates/m-p/620055#M50910</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-08T07:47:14Z</dc:date>
    </item>
  </channel>
</rss>

