<?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 How do I strip out part of the timestamp so I only get the date? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14941#M1600</link>
    <description>&lt;P&gt;I am trying to build a report where I want to summarize the number of
events for an entire year by day sorting by host tags. The issue I am
having is how to break the data apart in my search to search the date
based only on the month day and year and ignore the timestamp portion.
I see that the date is broken apart into fields but I cannot figure out
how to concatenate the filed parts into a single field. I am trying to
do something similar to a ANSI SQL date part function. &lt;/P&gt;</description>
    <pubDate>Sat, 05 Jun 2010 04:13:41 GMT</pubDate>
    <dc:creator>mctester</dc:creator>
    <dc:date>2010-06-05T04:13:41Z</dc:date>
    <item>
      <title>How do I strip out part of the timestamp so I only get the date?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14941#M1600</link>
      <description>&lt;P&gt;I am trying to build a report where I want to summarize the number of
events for an entire year by day sorting by host tags. The issue I am
having is how to break the data apart in my search to search the date
based only on the month day and year and ignore the timestamp portion.
I see that the date is broken apart into fields but I cannot figure out
how to concatenate the filed parts into a single field. I am trying to
do something similar to a ANSI SQL date part function. &lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2010 04:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14941#M1600</guid>
      <dc:creator>mctester</dc:creator>
      <dc:date>2010-06-05T04:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I strip out part of the timestamp so I only get the date?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14942#M1601</link>
      <description>&lt;P&gt;How does this work for you?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search_terms&amp;gt; | convert ctime(_time) as Time timeformat=%m/%d/%y 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you a new field called 'Time' with the format close to the way you want it.  You can also play around with the 'timeformat' to get it to display differently.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2010 04:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14942#M1601</guid>
      <dc:creator>Mick</dc:creator>
      <dc:date>2010-06-05T04:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I strip out part of the timestamp so I only get the date?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14943#M1602</link>
      <description>&lt;P&gt;In 4.1 you can also use the &lt;CODE&gt;strftime&lt;/CODE&gt; eval command like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search_terms&amp;gt; | eval Time=strftime(_time,"%m/%d/%y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need backwards compatibility with 4.0 or want to convert multiple times as once that going with &lt;CODE&gt;convert&lt;/CODE&gt; make the most sense.  Otherwise I feel like the &lt;CODE&gt;eval&lt;/CODE&gt; approach is slightly easier to understand.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2010 04:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14943#M1602</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-06-05T04:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I strip out part of the timestamp so I only get the date?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14944#M1603</link>
      <description>&lt;P&gt;If you are searching, you can search on the &lt;CODE&gt;date_year&lt;/CODE&gt; and &lt;CODE&gt;date_mday&lt;/CODE&gt; fields in your search. For display purposes, you can use the &lt;CODE&gt;convert&lt;/CODE&gt; search and &lt;CODE&gt;strftime()&lt;/CODE&gt; functions after you have search results.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2010 10:17:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14944#M1603</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-06-05T10:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I strip out part of the timestamp so I only get the date?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14945#M1604</link>
      <description>&lt;P&gt;This is probably too simple an observation but just in case.&lt;BR /&gt;
"trying to build a report where I want to summarize the number of events for an entire year by day sorting by host tags"  is a relatively simple thing to do.&lt;BR /&gt;
And it makes me think you just want a report of events by day, broken out per host tag.
You wouldnt need convert or eval to do that, it would just be: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | timechart span=1d count by hosttag
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;run that search over the 'year to date' option in the TimeRangePicker (under 'Other')&lt;/P&gt;

&lt;P&gt;This will give you a table where each row is a day, each column across the top is a host tag, and each cell is the count of events for that host tag on that day. &lt;/P&gt;

&lt;P&gt;by default timechart will only give you the top 10 hosttags, but you can throw a limit argument in there to raise it. &lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2010 12:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-strip-out-part-of-the-timestamp-so-I-only-get-the-date/m-p/14945#M1604</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-06-06T12:26:02Z</dc:date>
    </item>
  </channel>
</rss>

