<?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: How to combine two different time source fields into _time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481636#M134981</link>
    <description>&lt;P&gt;index = blah sourcetype = blah source IN ("*CSV-01","*CSV-02") |stats count by _time  City  "Traffic(GB)"|rename "Traffic(GB)"  as Traffic| fields - count&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:38:05 GMT</pubDate>
    <dc:creator>jarizeloyola</dc:creator>
    <dc:date>2020-09-30T03:38:05Z</dc:date>
    <item>
      <title>How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481635#M134980</link>
      <description>&lt;P&gt;Dears;&lt;/P&gt;

&lt;P&gt;how can I combine Date/Time of two different  source as follow;&lt;/P&gt;

&lt;P&gt;CSV-01(pic-1) and CSV-02(pic-2) input in splunk&lt;BR /&gt;
Query from splunk search and output as Splunk Query Output (pic-3)&lt;/P&gt;

&lt;P&gt;pls kindly help the way;&lt;/P&gt;

&lt;P&gt;&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/8190i4D09854C92CC8018/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>Fri, 10 Jan 2020 06:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481635#M134980</guid>
      <dc:creator>kaungset</dc:creator>
      <dc:date>2020-01-10T06:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481636#M134981</link>
      <description>&lt;P&gt;index = blah sourcetype = blah source IN ("*CSV-01","*CSV-02") |stats count by _time  City  "Traffic(GB)"|rename "Traffic(GB)"  as Traffic| fields - count&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:38:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481636#M134981</guid>
      <dc:creator>jarizeloyola</dc:creator>
      <dc:date>2020-09-30T03:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481637#M134982</link>
      <description>&lt;P&gt;UPDATED:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="CSV-01" OR index="CSV-02"
| eval Date=coalesce(Date, mvindex(split('Start Time'," "),0))
| eval Date=strptime(Date,"%d/%m/%Y")
| fieldformat Date=strftime(Date,"%d/%m/%Y")
| table Date City "Traffic(GB)" 
| rename "Traffic(GB)" as Traffic
| sort Traffic
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Previous Answer:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup csv_01
| append [ | inputlookup csv_02
| eval Date = mvindex(split('Start Time'," "),0)
| table Date City "Traffic(GB)" ]
| eval _time = strptime(Date,"%d/%m/%Y")
| rename "Traffic(GB)" as Traffic
| table _time City Traffic
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @kaungset&lt;BR /&gt;
How about this?&lt;/P&gt;

&lt;P&gt;P.S. It is better not to use a field name with spaces (ex. &lt;EM&gt;Start Time&lt;/EM&gt;)in CSV.&lt;BR /&gt;
if my query doesn't work, maybe field name problem occurs.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 12:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481637#M134982</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-10T12:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481638#M134983</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Thank You for your reply!&lt;/P&gt;

&lt;P&gt;Both source CSV format file 01 &amp;amp; 02 was already input to splunk and indexed.&lt;BR /&gt;
It was indexed as 3 time values as follow;&lt;/P&gt;

&lt;P&gt;_time(only system default), Date(1/30/2020), Start Time(1/30/2020 12:00:00 AM)&lt;/P&gt;

&lt;P&gt;I want to combine values of Date &amp;amp; Start Time as only Date field&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Date               City                Traffic&lt;BR /&gt;
1/30/2020       A                    102039&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 04:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481638#M134983</guid>
      <dc:creator>kaungset</dc:creator>
      <dc:date>2020-01-14T04:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481639#M134984</link>
      <description>&lt;P&gt;@kaungset&lt;BR /&gt;
I see. my answer is updated. please confirm.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 11:24:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481639#M134984</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-14T11:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481640#M134985</link>
      <description>&lt;P&gt;hi @to4kawa &lt;BR /&gt;
Thank You!&lt;/P&gt;

&lt;P&gt;when i try first SPL command line&lt;BR /&gt;&lt;BR /&gt;
1.&lt;EM&gt;| eval Date=coalesce(Date, mvindex(split('Start Time'," "),0))&lt;/EM&gt; was work&lt;/P&gt;

&lt;P&gt;but 2nd &amp;amp; 3rd doesn't work well.&lt;/P&gt;

&lt;P&gt;I try like this first line;&lt;BR /&gt;
1. index="main" &lt;BR /&gt;
    | eval d=coalesce(Date,mvindex(split('Start Time'," "),0))&lt;BR /&gt;
    | starts count by d&lt;/P&gt;

&lt;P&gt;but when I put 2nd &amp;amp; 3rd line it's show us No results found;&lt;BR /&gt;
1. index="main" &lt;BR /&gt;
    | eval d=coalesce(Date,mvindex(split('Start Time'," "),0))&lt;BR /&gt;
    | eval Date=strptime(d,"%d/%m/%Y")&lt;BR /&gt;
    | fieldformat Date=strftime(Date,"%d/%m/%Y")&lt;BR /&gt;
    | starts count by Date&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 02:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481640#M134985</guid>
      <dc:creator>kaungset</dc:creator>
      <dc:date>2020-01-16T02:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two different time source fields into _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481641#M134986</link>
      <description>&lt;P&gt;before &lt;CODE&gt;stats&lt;/CODE&gt;, if Date is, the problem is &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;BR /&gt;
if Date isn't, the problem is &lt;CODE&gt;strptime&lt;/CODE&gt;.&lt;BR /&gt;
but, I think no need &lt;CODE&gt;strptime&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 03:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-different-time-source-fields-into-time/m-p/481641#M134986</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-16T03:56:06Z</dc:date>
    </item>
  </channel>
</rss>

