<?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 make the _time from the source path? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648707#M53110</link>
    <description>It match everything before “/stdout…..” and you have “_stdout….” which obviously doesn’t match that.&lt;BR /&gt;So you must remove that / from regexp, then it should work.&lt;BR /&gt;&lt;A href="https://regex101.com/" target="_blank"&gt;https://regex101.com/&lt;/A&gt; Is good place to test those.</description>
    <pubDate>Thu, 29 Jun 2023 19:41:43 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2023-06-29T19:41:43Z</dc:date>
    <item>
      <title>How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648367#M53064</link>
      <description>&lt;P&gt;I have the following source path which I am monitoring..I want splunk to use the _time from the source file.&lt;BR /&gt;&lt;BR /&gt;/a/host*/ads/stdout.&lt;STRONG&gt;230621-125941&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 18:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648367#M53064</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2024-05-16T18:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648380#M53067</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;maybe these helps you?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-to-get-props-and-transforms-to-extract-time-from-source/m-p/641795#M109434" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/How-to-get-props-and-transforms-to-extract-time-from-source/m-p/641795#M109434&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/How-to-apply-source-file-date-using-INGEST-as-Time/m-p/596865&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 14:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648380#M53067</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-27T14:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648384#M53068</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; Thank you so much for you reply. I tried the below but I am not sure what mistake I am doing&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval source="/logs/abc*/mods/stdout.230626-203719" 
| fields - _time
``` above set test data ```
| eval _time = strptime(replace(source, ".*\/stdout.(\d{6}\-\d{6}).*","\1") + tostring(random() % 86400,"duration"),"%Y%m%d%H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 15:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648384#M53068</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-27T15:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648385#M53069</link>
      <description>&lt;P&gt;Your replace seems to be incorrect. It should be something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%y%m%d-%H%M%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 15:09:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648385#M53069</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-27T15:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648402#M53074</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; This is what I used and I dont see _time field&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval source="/svc-logs/hostabc/mods/stdout.230626-203719" 
| fields - _time
``` above set test data ```
| eval _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%y%m%d-%H%M%S")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jun 2023 16:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648402#M53074</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-27T16:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648411#M53075</link>
      <description>This _time is on your Time field on this event. Actually you should remove “| fields - _time” if you didn’t see Time on this one event.&lt;BR /&gt;Above is just test to get correct version for INGEST_EVAL expression to transforms.conf.</description>
      <pubDate>Tue, 27 Jun 2023 16:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648411#M53075</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-27T16:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648414#M53076</link>
      <description>&lt;P&gt;I get the below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="power12_0-1687884962412.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26040i73939C8A60F097AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="power12_0-1687884962412.png" alt="power12_0-1687884962412.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval source="/svc-logs/hostabc/mods/stdout.230626-203719"&lt;/P&gt;&lt;P&gt;``` above set test data ```&lt;BR /&gt;| eval _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%y%m%d-%H%M%S")&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 16:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648414#M53076</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-27T16:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648422#M53080</link>
      <description>As I expecting that century is 20xx, you should use %Y instead of %y on strptime function.</description>
      <pubDate>Tue, 27 Jun 2023 18:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648422#M53080</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-27T18:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648430#M53081</link>
      <description>&lt;P&gt;Thank you it worked&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 19:10:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648430#M53081</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-27T19:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648600#M53101</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I Added below conf...but somehow the data still did not take the source path time.Is there other steps I need to add&lt;BR /&gt;props.conf&lt;/P&gt;&lt;P&gt;[&amp;lt; sourcetype name&amp;gt;]&lt;BR /&gt;TRANSFORMS-set_time = set_time_from_source_path&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Added below in transforms.conf&lt;/P&gt;&lt;P&gt;[set_time_from_file_path]&lt;BR /&gt;INGEST_EVAL = _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%Y%m%d-%H%M%S")&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 20:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648600#M53101</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-28T20:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648606#M53102</link>
      <description>Was it typo or are those name different on your conf files?</description>
      <pubDate>Wed, 28 Jun 2023 22:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648606#M53102</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-28T22:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648671#M53105</link>
      <description>&lt;P&gt;I tried this as well&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;[&amp;lt; sourcetype name&amp;gt;]&lt;BR /&gt;TRANSFORMS-set_time = set_time_from_file_path&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Added below in transforms.conf&lt;/P&gt;&lt;P&gt;[set_time_from_file_path]&lt;BR /&gt;INGEST_EVAL = _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%Y%m%d-%H%M%S")&lt;BR /&gt;&lt;BR /&gt;Should we have the "set_time" extension after the TRANSFORMS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 15:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648671#M53105</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-29T15:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648673#M53106</link>
      <description>&lt;P&gt;That should works. Have you restarted splunk and then remember that this is applied only a new ingested events, not for those which are already indexed.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 15:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648673#M53106</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-29T15:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648691#M53107</link>
      <description>&lt;P&gt;Yes...I did restart splunk after applying that...I tried mimicking the same on my local.&lt;BR /&gt;&lt;BR /&gt;I went to my local (C:\Program Files\Splunk\etc\apps\search\local) where I set the transforms to be&lt;BR /&gt;&lt;BR /&gt;[set_time_from_source_path]&lt;BR /&gt;INGEST_EVAL = _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%Y%m%d-%H%M%S")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and in the props.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[sourcetime]&lt;BR /&gt;LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;SHOULD_LINEMERGE = false&lt;BR /&gt;category = Custom&lt;BR /&gt;disabled = false&lt;BR /&gt;pulldown_type = true&lt;BR /&gt;TRANSFORMS-set_time = set_time_from_source_path&lt;BR /&gt;&lt;BR /&gt;Restarted&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Then from WEB UI---&amp;gt;ADD DATA --&amp;gt;SELECTED FILE (_svc-logs_hostbac_mods_stdout.230629-053900) --&amp;gt;selected sourcetype (sourcetime) to see the preview I get errors(attached) that its failed to parse time&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="power12_0-1688058446136.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26075i9CC63B15203CC3A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="power12_0-1688058446136.png" alt="power12_0-1688058446136.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 17:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648691#M53107</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-29T17:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648703#M53108</link>
      <description>&lt;P&gt;On your example the source was “foo/bar/stdout.230629-123456” and now you are trying to use source “foo.bar.stdout.230629-123456”. Obviously that doesn’t match our regex on replace function. You must fix that to match your real source path!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 19:06:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648703#M53108</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-29T19:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648704#M53109</link>
      <description>&lt;P&gt;In the regex&amp;nbsp; its looking for&amp;nbsp;&lt;SPAN&gt;.*/stdout so even if its _ or . ..it matches everything until stdout right&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;INGEST_EVAL = _time = strptime(replace(source, ".*/stdout.(\d{6}-\d{6}).*","20\1"),"%Y%m%d-%H%M%S")&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 19:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648704#M53109</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-29T19:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648707#M53110</link>
      <description>It match everything before “/stdout…..” and you have “_stdout….” which obviously doesn’t match that.&lt;BR /&gt;So you must remove that / from regexp, then it should work.&lt;BR /&gt;&lt;A href="https://regex101.com/" target="_blank"&gt;https://regex101.com/&lt;/A&gt; Is good place to test those.</description>
      <pubDate>Thu, 29 Jun 2023 19:41:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648707#M53110</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-29T19:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648709#M53111</link>
      <description>&lt;P&gt;I can try that but I am testing on my windows local splunk installed trying to do the same from&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;C:\Users\vv\OneDrive-xx\Pictures\svc-logs\hostabc\mods\stdout.230629-081216.txt for this I changed it to&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;[set_time_from_source_path]&lt;BR /&gt;INGEST_EVAL = _time = strptime(replace(source, ".*\\stdout.(\d{6}-\d{6}).*","20\1"),"%Y%m%d-%H%M%S")&lt;/P&gt;&lt;P&gt;This also did not work.&lt;BR /&gt;&lt;BR /&gt;I am assuming something with&amp;nbsp;"20\1"..how do we change that..Can you please let me know what should be changed for this case&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 20:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648709#M53111</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-29T20:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648710#M53112</link>
      <description>&lt;P&gt;You need just change this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;INGEST_EVAL = _time = strptime(replace(source, ".*stdout.(\d{6}-\d{6}).*","20\1"),"%Y%m%d-%H%M%S")&lt;/LI-CODE&gt;&lt;P&gt;then it works both windows and Linux.&lt;BR /&gt;&lt;BR /&gt;When you are escaping \, the amount of needed \ is depending where you are using it (props, rex, …). Good rule of thumb is start with one and adding those as many as needed (sometimes until 4-6 is needed).&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 20:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648710#M53112</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-29T20:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to make the _time from the source path?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648711#M53113</link>
      <description>&lt;P&gt;Ya even tried that but somehow it says "&lt;STRONG&gt;could not use regex to parse timestamp from source::source::C:\Users\vv\OneDrive-xx\Pictures\svc-logs\hostabc\mods\stdou.&lt;/STRONG&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 20:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-make-the-time-from-the-source-path/m-p/648711#M53113</guid>
      <dc:creator>power12</dc:creator>
      <dc:date>2023-06-29T20:34:51Z</dc:date>
    </item>
  </channel>
</rss>

