<?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 Force Splunk to Read Date as a Value but Display as Human Readable in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399792#M26198</link>
    <description>&lt;P&gt;I am working on creating an other than normal bubble chart. -Basically i am plotting 2 string values/categories (y-axis, and color), 1 numeric value ( bubble size),  all over time(x-axis). I know this is traditionally NOT what bubble charts are for but this is what the requirement is. Currently i am able to "trick" the chart to plot the data correctly by converting the timestamp into Epoch time and then using epoch as a value number. This plots the data correctly but now i want to be able to view the x axis as the dates not epoch millions values. &lt;/P&gt;

&lt;P&gt;I see 2 ways to solve this, create a post-stats command but pre-table command that convert the timestamp into somewhat readable format but still forces Splunk to read it as a numeric value &lt;/P&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;P&gt;Honestly more preferred do some kind of custom html that would allow me to change the values of the axis that are displayed, and keep the plotting values "behind the curtain"&lt;BR /&gt;
-my y axis i had to change to string value IDs and would like those displayed as the string value as well as they are currently being displayed as numbers..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=hidden sourcetype=hidden 
| eval z_axis=if("a special calculation that generates a value") 
| convert timeformat="%Y-%m-%d %H:%M:%S" mktime(_time) as date
| stats sum(z_axis) as "Score" by "Value", date, ID 
| table "Value", date, ID, "Score"![alt text][1]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Jun 2018 17:14:27 GMT</pubDate>
    <dc:creator>masonwhite</dc:creator>
    <dc:date>2018-06-21T17:14:27Z</dc:date>
    <item>
      <title>Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399792#M26198</link>
      <description>&lt;P&gt;I am working on creating an other than normal bubble chart. -Basically i am plotting 2 string values/categories (y-axis, and color), 1 numeric value ( bubble size),  all over time(x-axis). I know this is traditionally NOT what bubble charts are for but this is what the requirement is. Currently i am able to "trick" the chart to plot the data correctly by converting the timestamp into Epoch time and then using epoch as a value number. This plots the data correctly but now i want to be able to view the x axis as the dates not epoch millions values. &lt;/P&gt;

&lt;P&gt;I see 2 ways to solve this, create a post-stats command but pre-table command that convert the timestamp into somewhat readable format but still forces Splunk to read it as a numeric value &lt;/P&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;P&gt;Honestly more preferred do some kind of custom html that would allow me to change the values of the axis that are displayed, and keep the plotting values "behind the curtain"&lt;BR /&gt;
-my y axis i had to change to string value IDs and would like those displayed as the string value as well as they are currently being displayed as numbers..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=hidden sourcetype=hidden 
| eval z_axis=if("a special calculation that generates a value") 
| convert timeformat="%Y-%m-%d %H:%M:%S" mktime(_time) as date
| stats sum(z_axis) as "Score" by "Value", date, ID 
| table "Value", date, ID, "Score"![alt text][1]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399792#M26198</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399793#M26199</link>
      <description>&lt;P&gt;Presenting something in a readable format, while keeping the numeric value under the hood sounds like a job for the &lt;CODE&gt;fieldformat&lt;/CODE&gt; command, which does exactly that.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldformat"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldformat&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=hidden sourcetype=hidden 
 | eval z_axis=if("a special calculation that generates a value") 
 | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(_time) as date
 | fieldformat date = strftime(date,"%Y-%m-%d %H:%M:%S")
 | stats sum(z_axis) as "Score" by "Value", date, ID 
 | table "Value", date, ID, "Score"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: why the convert and mktime? The _time field already is an epoch value normally (but presented in the GUI as a readable string). So I think the following should be the same:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=hidden sourcetype=hidden 
 | eval z_axis=if("a special calculation that generates a value") 
 | eval date = _time
 | fieldformat date = strftime(date,"%Y-%m-%d %H:%M:%S")
 | stats sum(z_axis) as "Score" by "Value", date, ID 
 | table "Value", date, ID, "Score"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Of course in either case, adjust the time format string in the fieldformat command to your preference.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:19:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399793#M26199</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-21T17:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399794#M26200</link>
      <description>&lt;P&gt;fieldformat may work... any idea how to fieldformat an epoch number into a date? im drawing a blank on my end. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399794#M26200</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399795#M26201</link>
      <description>&lt;P&gt;See my updated answer, just adjust the time format string to whatever you want. If you just want the date printed, then use "%Y-%m-%d" for instance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399795#M26201</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-21T17:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399796#M26202</link>
      <description>&lt;P&gt;For some reason when using _time or the query with the fieldformat the bubble chart doesnt understand the values. i included a screenshot of what the chart looks like after doing the fieldformat. its almost as if i need to edit the values after the chart is rendered...? &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/5249i51050B57E35974DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399796#M26202</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399797#M26203</link>
      <description>&lt;P&gt;if you are able to open the first jpg "bubble" this is the data plotted correctly and then view the second jpg "bubble2" this is what happens when any manipulation to the values is done &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399797#M26203</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399798#M26204</link>
      <description>&lt;P&gt;What if you move the fieldformat a bit further down (all the way to the bottom perhaps, but at least past the stats command)?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399798#M26204</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-21T17:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399799#M26205</link>
      <description>&lt;P&gt;Also yes your are correct the convert mktime was a redundant command and the chart does still plot correctly with the eval command. the issue i was having was i was trying to use _time in my stats command, which did not work. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399799#M26205</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399800#M26206</link>
      <description>&lt;P&gt;tried that, moved alll the way to the last line,  it still renders the chart with the values post field format&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399800#M26206</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399801#M26207</link>
      <description>&lt;P&gt;You could try printing the date as 20180621, such that is a number and properly sorts. Not as pretty, but may do the job?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:49:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399801#M26207</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-21T17:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399802#M26208</link>
      <description>&lt;P&gt;ahh good idea, same concept im doing now. if all else fails that is much better than 1,534,566,000... haha&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 17:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399802#M26208</guid>
      <dc:creator>masonwhite</dc:creator>
      <dc:date>2018-06-21T17:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Force Splunk to Read Date as a Value but Display as Human Readable</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399803#M26209</link>
      <description>&lt;P&gt;I got an example working locally. This format works, but the x-axis is continuous, so you get a bunch of whitespace between 20180531 and 2010601...&lt;BR /&gt;
And it still prints thousands separators.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 18:03:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Force-Splunk-to-Read-Date-as-a-Value-but-Display-as-Human/m-p/399803#M26209</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-21T18:03:14Z</dc:date>
    </item>
  </channel>
</rss>

