<?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 apply source file date using INGEST as Time? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865#M104191</link>
    <description>&lt;P&gt;Sorry for the delay in responding, the setting is not applied, and it appears in N/NaN/NaN form in the time file during the test.&lt;/P&gt;&lt;P&gt;And I want to format %Y/%m/%d %T&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2022 01:38:46 GMT</pubDate>
    <dc:creator>noott211</dc:creator>
    <dc:date>2022-05-09T01:38:46Z</dc:date>
    <item>
      <title>How to apply source file date using INGEST as Time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596328#M104124</link>
      <description>&lt;P&gt;There's no time in my log&lt;BR /&gt;&lt;BR /&gt;You want to extract the source file date using the INGEST command&lt;/P&gt;
&lt;P&gt;Source name &amp;nbsp;/var/log/data_20220507.log&lt;/P&gt;
&lt;P&gt;How can I add random time after the date over there?&lt;BR /&gt;&lt;BR /&gt;i want _time = 2022/05/07 11:23:22.2&lt;BR /&gt;&lt;BR /&gt;I would appreciate it if you could tell me the settings of Props.conf transforms.conf&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 04:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596328#M104124</guid>
      <dc:creator>noott211</dc:creator>
      <dc:date>2022-05-04T04:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply source file date using INGEST as Time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596351#M104125</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;FIXED: 2023-05-25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try something like this&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[source::/var/log/data_*.log]
TRANSFORMS-set_time = set_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[set_time]
INGEST_EVAL = _time = strptime(replace(source, ".*/data_(\d{8}).*","\1") + tostring(random() % 86400,"duration"),"%Y%m%d%H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or test in GUI:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval source="/var/log/data_20220507.log" 
| fields - _time
``` above set test data ```
| eval _time = strptime(replace(source, ".*/data_(\d{8}).*","\1") + tostring(random() % 86400,"duration"),"%Y%m%d%H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't tested those files, just in GUI, so there could be some mistakes, but &amp;nbsp;base idea is working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 08:22:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596351#M104125</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-05-25T08:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply source file date using INGEST as Time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865#M104191</link>
      <description>&lt;P&gt;Sorry for the delay in responding, the setting is not applied, and it appears in N/NaN/NaN form in the time file during the test.&lt;/P&gt;&lt;P&gt;And I want to format %Y/%m/%d %T&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 01:38:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865#M104191</guid>
      <dc:creator>noott211</dc:creator>
      <dc:date>2022-05-09T01:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply source file date using INGEST as Time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596867#M104192</link>
      <description>&lt;P&gt;A date format issue has been resolved, but logs are captured based on the current time. Is it a priority issue? I didn't do it No other time-related settings were performed.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 02:10:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596867#M104192</guid>
      <dc:creator>noott211</dc:creator>
      <dc:date>2022-05-09T02:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply source file date using INGEST as Time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/644601#M109721</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I just fixed those props.conf and transforms.conf with the correct definitions.&lt;/P&gt;&lt;P&gt;Format of _time field is defined by your localisation. If you need to see it in another format then you should use some other field to show it in your needed way.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 08:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/644601#M109721</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-05-25T08:25:00Z</dc:date>
    </item>
  </channel>
</rss>

