<?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: Can and cannot overwrite _time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79960#M20215</link>
    <description>&lt;P&gt;It's better to say "Thank you very much kallu!" late than never:) I've implemented your suggestion and it have saved lots of my time and nerves.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2012 16:09:23 GMT</pubDate>
    <dc:creator>iKate</dc:creator>
    <dc:date>2012-12-11T16:09:23Z</dc:date>
    <item>
      <title>Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79951#M20206</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;

&lt;P&gt;I made a table that shows web sources from where visitors come to our service. &lt;BR /&gt;
By clicking any row timechart of visitors for the selected source opens. &lt;EM&gt;But it opens not for each source&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;The data that is used for these tables and charts doesn't have _time parameter but has year, month, day values. By concatenating these values and converting to timestamp I got _time and built timechart. &lt;/P&gt;

&lt;P&gt;Here is working example with source "yandex":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=visitors source=web | where source_from="yandex" | strcat year "." month "." day date | convert timeformat="%Y.%m.%d" mktime(date) as _time | timechart sum(visitors) as visitors 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not working example with source "google" though it has 5 times more occurances in our statistics then "yandex":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=visitors source=web | where source_from="google" | strcat year "." month "." day date | convert timeformat="%Y.%m.%d" mktime(date) as _time | timechart sum(visitors) as visitors 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The data seems to be similar for these sources, has no gaps in days.&lt;/P&gt;

&lt;P&gt;I found that in the second variant splunk can't write result into _time. Trying to use eval _time=.. or strftime didn't helped. How can I write to _time to use timechart?  &lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 11:21:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79951#M20206</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-10-04T11:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79952#M20207</link>
      <description>&lt;P&gt;Not strictly an answer, but - what are you using as timestamp in Splunk right now? It seems you want to sidestep that completely, so why not use the time you want to use in your searches anyway instead?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 14:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79952#M20207</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-04T14:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79953#M20208</link>
      <description>&lt;P&gt;As a timestamp I meen date&amp;amp;time in epoch time format like 123421341342.&lt;BR /&gt;
Typically time information is presented in our raw data but not in this case.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 14:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79953#M20208</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-10-04T14:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79954#M20209</link>
      <description>&lt;P&gt;Splunk can do epoch. What do you mean that it's not presented in your data? You have fields containing date information so that information must be in there somewhere.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 15:29:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79954#M20209</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-04T15:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79955#M20210</link>
      <description>&lt;P&gt;Correct me if I am wrong but _time is a default metadata field. Metadata can only be overwritten during time of index with a transform. Try using the chart command.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
index=visitors source=web | where source_from="google" | strcat year "." month "." day date | convert timeformat="%Y.%m.%d" mktime(date) as ctime | chart sum(visitors) as visitors over ctime as(time)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 15:51:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79955#M20210</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-10-04T15:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79956#M20211</link>
      <description>&lt;P&gt;@Ayn @bmacias84 You're right, _time is a default metadata, but in our case this is data from indexed .csv file so _time value for all entries has the same value of its indexing time.&lt;BR /&gt;
@bmacias84 sorry, I didn't catch what did you expect 'as(time)' should make. In fact 'chart sum(visitors) as visitors over ctime' is the way I'm doing the chart, but it's still unclear why timechart works in this case occasionaly.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 08:02:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79956#M20211</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-10-05T08:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79957#M20212</link>
      <description>&lt;P&gt;Could you provide us with a sample from the CSV file? I still think that you should focus on getting your timestamp recognition setup properly instead of messing with workarounds.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 09:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79957#M20212</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-05T09:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79958#M20213</link>
      <description>&lt;P&gt;Yes, sure, here's a piece of csv:&lt;/P&gt;

&lt;P&gt;ga:year, ga:month, ga:day, ga:source, ga:visitors&lt;BR /&gt;
2012,07,02,google,1907&lt;BR /&gt;
2012,07,02,yandex,1009&lt;BR /&gt;
2012,07,03,google,2090&lt;BR /&gt;
2012,07,03,yandex,1598&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 10:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79958#M20213</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-10-05T10:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79959#M20214</link>
      <description>&lt;P&gt;Like Ayn said, your life will be much easier if you extract timestamps from CSV.&lt;BR /&gt;
Something like this in your props.conf should do it.&lt;/P&gt;

&lt;PRE&gt;
    [web_visitors]
    MAX_TIMESTAMP_LOOKAHEAD = 10
    NO_BINARY_CHECK = 1
    SHOULD_LINEMERGE = false
    TIME_FORMAT = %Y,%m,%d
    TZ=UTC
    EXTRACT-web_visitors = (?i)^\d+,\d+,\d+,(?P&amp;lt;source_from&amp;gt;[^,]+),(?P&amp;lt;visitors&amp;gt;.+)$
&lt;/PRE&gt;

&lt;P&gt;This should parse both timestamp and "from" &amp;amp; "visitors" -fields from your CSV.&lt;/P&gt;

&lt;P&gt;And if CSV header gets annoying, here is some ideas what you can do for it&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/49366/how-to-ignore-first-three-line-of-my-log"&gt;http://splunk-base.splunk.com/answers/49366/how-to-ignore-first-three-line-of-my-log&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Oct 2012 18:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79959#M20214</guid>
      <dc:creator>kallu</dc:creator>
      <dc:date>2012-10-06T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can and cannot overwrite _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79960#M20215</link>
      <description>&lt;P&gt;It's better to say "Thank you very much kallu!" late than never:) I've implemented your suggestion and it have saved lots of my time and nerves.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2012 16:09:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-and-cannot-overwrite-time/m-p/79960#M20215</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-12-11T16:09:23Z</dc:date>
    </item>
  </channel>
</rss>

