<?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 to Assign Values  for _time at Index Time for Future Searching? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190275#M37891</link>
    <description>&lt;P&gt;I have a CSV file that I would like to index one time only.  There are two fields (Date, Time) that I want to be able to use as &lt;EM&gt;_time&lt;/EM&gt; so that I can create a correlation of avg/median response times with data being forwarded in to a different index down the line.  Are there attributes  I can add to props.conf to help with this?  Here is what my current props configurations look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[oms_invoice_data]
HEADER_MODE = firstline
SHOULD_LINEMERGE = false
TIME_PREFIX = ^
TIME_FORMAT = %Y%m%d,%H%M%S
MAX_TIMESTAMP_LOOKAHEAD = 15
EXTRACT-oms_invoice_data=(?&amp;lt;Date&amp;gt;[^,]*),\s*(?&amp;lt;Time&amp;gt;[^,]*),\s*(?&amp;lt;Division&amp;gt;[^,]*),\s*(?&amp;lt;Customer&amp;gt;[^,]*),\s*(?&amp;lt;BillTo&amp;gt;[^,]*),\s*(?&amp;lt;DiversityCustomer&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceTypes&amp;gt;[^,]*),\s*(?&amp;lt;EDI&amp;gt;[^,]*),\s*(?&amp;lt;PDV&amp;gt;[^,]*),\s*(?&amp;lt;PAPER&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceNumber&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceAmount&amp;gt;[^,]*),\s*(?&amp;lt;LegacyEDI&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively, is there a way I could manipulate the search to concatenate these values, and then later coalesce &lt;CODE&gt;_time&lt;/CODE&gt; with &lt;CODE&gt;time&lt;/CODE&gt; (custom time field) to be able to calculate &lt;CODE&gt;earliest/latest _time&lt;/CODE&gt; and find durations that way?  I tried doing something like this but things didn't work out as I had hoped (knowing I can't reassign &lt;CODE&gt;_time&lt;/CODE&gt; respectively:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=oms_invoice_data source="/tmp/oms_invoice_data_0504_0510.csv" EDI=1 OR LegacyEDI=1 InvoiceTypes=EDI* Date=20150504
| table Date,Time, InvoiceNumber InvoiceAmount, 
| mvexpand InvoiceNumber 
| eval SourceSystem="OMS"
| eval Date = strftime(Date, "%Y/%m/%d")
| eval Time = strftime(Time,"%H:%M:%S")
| eval time=Date. " " .Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The weird thing here is that time is displayed as &lt;CODE&gt;1970/08/22 09:46:53&lt;/CODE&gt; rather than &lt;CODE&gt;2015/05/04 09:46:53&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Essentially what I am looking for is being able to calculate &lt;CODE&gt;earliest(_time)&lt;/CODE&gt; and &lt;CODE&gt;latest(_time)&lt;/CODE&gt; so that for one day, 05/04 for example), I can calculate the end-to-end avg and median response time for each transaction.&lt;/P&gt;

&lt;P&gt;Any thoughts on this would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2015 16:16:05 GMT</pubDate>
    <dc:creator>_gkollias</dc:creator>
    <dc:date>2015-05-18T16:16:05Z</dc:date>
    <item>
      <title>How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190275#M37891</link>
      <description>&lt;P&gt;I have a CSV file that I would like to index one time only.  There are two fields (Date, Time) that I want to be able to use as &lt;EM&gt;_time&lt;/EM&gt; so that I can create a correlation of avg/median response times with data being forwarded in to a different index down the line.  Are there attributes  I can add to props.conf to help with this?  Here is what my current props configurations look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[oms_invoice_data]
HEADER_MODE = firstline
SHOULD_LINEMERGE = false
TIME_PREFIX = ^
TIME_FORMAT = %Y%m%d,%H%M%S
MAX_TIMESTAMP_LOOKAHEAD = 15
EXTRACT-oms_invoice_data=(?&amp;lt;Date&amp;gt;[^,]*),\s*(?&amp;lt;Time&amp;gt;[^,]*),\s*(?&amp;lt;Division&amp;gt;[^,]*),\s*(?&amp;lt;Customer&amp;gt;[^,]*),\s*(?&amp;lt;BillTo&amp;gt;[^,]*),\s*(?&amp;lt;DiversityCustomer&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceTypes&amp;gt;[^,]*),\s*(?&amp;lt;EDI&amp;gt;[^,]*),\s*(?&amp;lt;PDV&amp;gt;[^,]*),\s*(?&amp;lt;PAPER&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceNumber&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceAmount&amp;gt;[^,]*),\s*(?&amp;lt;LegacyEDI&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively, is there a way I could manipulate the search to concatenate these values, and then later coalesce &lt;CODE&gt;_time&lt;/CODE&gt; with &lt;CODE&gt;time&lt;/CODE&gt; (custom time field) to be able to calculate &lt;CODE&gt;earliest/latest _time&lt;/CODE&gt; and find durations that way?  I tried doing something like this but things didn't work out as I had hoped (knowing I can't reassign &lt;CODE&gt;_time&lt;/CODE&gt; respectively:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=oms_invoice_data source="/tmp/oms_invoice_data_0504_0510.csv" EDI=1 OR LegacyEDI=1 InvoiceTypes=EDI* Date=20150504
| table Date,Time, InvoiceNumber InvoiceAmount, 
| mvexpand InvoiceNumber 
| eval SourceSystem="OMS"
| eval Date = strftime(Date, "%Y/%m/%d")
| eval Time = strftime(Time,"%H:%M:%S")
| eval time=Date. " " .Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The weird thing here is that time is displayed as &lt;CODE&gt;1970/08/22 09:46:53&lt;/CODE&gt; rather than &lt;CODE&gt;2015/05/04 09:46:53&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Essentially what I am looking for is being able to calculate &lt;CODE&gt;earliest(_time)&lt;/CODE&gt; and &lt;CODE&gt;latest(_time)&lt;/CODE&gt; so that for one day, 05/04 for example), I can calculate the end-to-end avg and median response time for each transaction.&lt;/P&gt;

&lt;P&gt;Any thoughts on this would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 16:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190275#M37891</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-18T16:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190276#M37892</link>
      <description>&lt;P&gt;It'd help if you posted a sample of your CSV file.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 16:31:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190276#M37892</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-18T16:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190277#M37893</link>
      <description>&lt;P&gt;Sure thing - Here are the top 5 lines with edited values:&lt;/P&gt;

&lt;P&gt;Date Time Division Customer Bill-To DiversityCustomer InvoiceTypes EDI PDV PAPER    InvoiceNumber InvoiceAmount LegacyEDI&lt;BR /&gt;&lt;BR /&gt;
20150504 53141  ATL 1234567 12345 N PDV  0  1   0   001 382.61  0&lt;BR /&gt;&lt;BR /&gt;
20150504 53218  ATL 1234567 12345 N EDI &amp;amp; PAPER 1   0   1   002 231.14  0&lt;BR /&gt;&lt;BR /&gt;
20150504 53218  ATL 1234567 12345 N EDI &amp;amp; PAPER 1   0   1   003 245.19  0&lt;BR /&gt;&lt;BR /&gt;
20150504 53218  ATL 1234567 12345 N EDI &amp;amp; PAPER 1   0   1   004 19.03   0       &lt;/P&gt;

&lt;P&gt;Also, this CSV file contains 7 days worth of data (5/4 to 5/10). With the above search I am only looking to start with 5/4.  If I need to re-index the file I can do that.  Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 17:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190277#M37893</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-18T17:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190278#M37894</link>
      <description>&lt;P&gt;Are you sure that's the right CSV file? I see no commas separating the values...&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 17:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190278#M37894</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-18T17:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190279#M37895</link>
      <description>&lt;P&gt;I copied that right from the original spreadsheet.  Here is the same one I am indexing from /tmp/:&lt;/P&gt;

&lt;P&gt;InvoiceDate,InvoiceTime,Division,Customer,BillTo,DiversityCustomer,InvoiceTypes,EDI,PDV,PAPER,InvoiceNumber,InvoiceAmount,LegacyEDI&lt;BR /&gt;
20150504,53141,ATL,12345,12345,N,PDV,0,1,0,001,382.61,0&lt;BR /&gt;
20150504,53218,ATL,12345,12345,N,EDI &amp;amp; PAPER,1,0,1,002,231.14,0&lt;BR /&gt;
20150504,53218,ATL,12345,12345,N,EDI &amp;amp; PAPER,1,0,1,003,245.19,0&lt;BR /&gt;
20150504,53218,ATL,12345,12345,N,EDI &amp;amp; PAPER,1,0,1,004,19.03,0&lt;BR /&gt;
20150504,53153,ATL,12345,12345,N,EDI &amp;amp; PAPER,1,0,1,005,251.54,0&lt;BR /&gt;
20150504,53153,ATL,12345,12345,N,EDI &amp;amp; PAPER,1,0,1,006,146.92,0&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 17:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190279#M37895</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-18T17:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190280#M37896</link>
      <description>&lt;P&gt;then in props I extract InvoiceDate and InvoiceTime as Date, Time&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 17:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190280#M37896</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-18T17:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190281#M37897</link>
      <description>&lt;P&gt;If your &lt;CODE&gt;InvoiceTime&lt;/CODE&gt; column had a leading zero for the hour you could use these settings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo]
TIME_FORMAT=%Y%m%d%H%M%S
TIMESTAMP_FIELDS=InvoiceDate,InvoiceTime
SHOULD_LINEMERGE=false
INDEXED_EXTRACTIONS=csv
NO_BINARY_CHECK=true
KV_MODE=none
disabled=false
pulldown_type=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That would assign &lt;CODE&gt;_time&lt;/CODE&gt; correctly from the get-go so you don't need to do any more maths at search time.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 18:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190281#M37897</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-18T18:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190282#M37898</link>
      <description>&lt;P&gt;Thanks!  I modified the props.conf and am re-indexing the file now.  I will let you know how things look!&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 18:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190282#M37898</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-18T18:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190283#M37899</link>
      <description>&lt;P&gt;This didn't work, unfortunately.  I tried using a few different attributes but no luck.  Is it possible to use custom XML to format the logging?&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 19:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190283#M37899</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-18T19:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190284#M37900</link>
      <description>&lt;P&gt;Did you add a leading zero to the hour of your &lt;CODE&gt;InvoiceTime&lt;/CODE&gt; column?&lt;/P&gt;

&lt;P&gt;There is no XML at index time so I'm not sure what you're referring to.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 20:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190284#M37900</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-18T20:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190285#M37901</link>
      <description>&lt;P&gt;Here is the solution:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Props.conf&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo]
    TIME_PREFIX=^
    MAX_TIMESTAMP_LOOKAHEAD=15
    DATETIME_CONFIG=/etc/apps/props/default/oms_invoice_data_datetime.xml
    SHOULD_LINEMERGE=false
    EXTRACT-oms_invoice_data=(?&amp;lt;Date&amp;gt;[^,]*),\s*(?&amp;lt;Time&amp;gt;[^,]*),\s*(?&amp;lt;Division&amp;gt;[^,]*),\s*(?&amp;lt;Customer&amp;gt;[^,]*),\s*(?&amp;lt;BillTo&amp;gt;[^,]*),\s*(?&amp;lt;DiversityCustomer&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceTypes&amp;gt;[^,]*),\s*(?&amp;lt;EDI&amp;gt;[^,]*),\s*(?&amp;lt;PDV&amp;gt;[^,]*),\s*(?&amp;lt;PAPER&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceNumber&amp;gt;[^,]*),\s*(?&amp;lt;InvoiceAmount&amp;gt;[^,]*),\s*(?&amp;lt;LegacyEDI&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;XML File that Strips Datetime&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;
    &amp;lt;define name="_oms_csv_timestamp" extract="year, month, day, hour, minute, second"&amp;gt;
        &amp;lt;text&amp;gt;(\d{4})(\d{2})(\d{2}),(\d{1,2})(\d{2})(\d{2})&amp;lt;/text&amp;gt;
    &amp;lt;/define&amp;gt;
    &amp;lt;timePatterns&amp;gt;
        &amp;lt;use name="_oms_csv_timestamp"/&amp;gt;
    &amp;lt;/timePatterns&amp;gt;
    &amp;lt;datePatterns&amp;gt;
        &amp;lt;use name="_oms_csv_timestamp"/&amp;gt;
    &amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This pulls out the exact timestamp from the CSV.  The XML file resides in props.conf.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 00:06:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/190285#M37901</guid>
      <dc:creator>_gkollias</dc:creator>
      <dc:date>2015-05-19T00:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign Values  for _time at Index Time for Future Searching?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/704914#M116590</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/174728"&gt;@_gkollias&lt;/a&gt;&amp;nbsp;It looks like you are trying to process EDI data.&amp;nbsp; We do have a solutions accelerator for EDI, we can share.&amp;nbsp; Are you interesting in learning about it?&amp;nbsp; Love to set-up some time to share what we have.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 08:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-Assign-Values-for-time-at-Index-Time-for-Future-Searching/m-p/704914#M116590</guid>
      <dc:creator>youngc_splunk</dc:creator>
      <dc:date>2024-11-21T08:12:44Z</dc:date>
    </item>
  </channel>
</rss>

