<?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 i set date by log path address ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186121#M53614</link>
    <description>&lt;P&gt;when i put date in file name like tran20150511.log&lt;BR /&gt;
and in  datetime.xml seeting for date part i useis: [CDATA[source::.*?tran(\d{4})(\d{2})(\d{2})]]&lt;BR /&gt;
and in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DATETIME_CONFIG = C:\Program Files\Splunk\etc\apps\search\datetimee.xml
EXTRACT-fields = (?&amp;amp;lt;time&amp;amp;gt;\d{2}:\d{2}:\d{2}\.\d{3})\|(?&amp;amp;lt;audit&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;serviceType&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;processId&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;serviceName&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;indicator&amp;amp;gt;[^\|]+)\|(?P&amp;amp;lt;message&amp;amp;gt;
LINE_BREAKER = ([\r\n]+)\d{2}:\d{2}:\d{2}\.\d{3}\|[^\|]+\|[^\|]+\|[^\|]+\|[^\|]+\|[^\|]+\|
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
category = Custom
disabled = false
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then they take date correctly but&lt;BR /&gt;&lt;BR /&gt;
by folder they not take date&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2015 09:34:16 GMT</pubDate>
    <dc:creator>nitesh218ss</dc:creator>
    <dc:date>2015-05-15T09:34:16Z</dc:date>
    <item>
      <title>How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186113#M53606</link>
      <description>&lt;P&gt;Hi have a log which is inside folder which folder name is date&lt;BR /&gt;
i give folder name or path is=&lt;BR /&gt;
   &lt;CODE&gt;C:\Users\T_NiteshS1\Documents\My Received Files\20150511\log2.log&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you see before log2.log you get folder 20150511 This is date&lt;BR /&gt;
if you expend 20150511 this yyyymmdd  &lt;/P&gt;

&lt;P&gt;how is set in datetime.xml i don't now xml&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 06:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186113#M53606</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-12T06:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186114#M53607</link>
      <description>&lt;P&gt;i use in xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;amp;lt;define name="_masheddate2" extract="month, day, year"&amp;amp;gt;
    &amp;amp;lt;text&amp;amp;gt;&amp;amp;lt;![CDATA[(?:^|C:\Program Files\Splunk\etc\apps\search::).*?(20\d{2})(\d{2})(\d{2})]]&amp;amp;gt;&amp;amp;lt;/text&amp;amp;gt;
&amp;amp;lt;/define&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i use in   props.conf&lt;BR /&gt;
DATETIME_CONFIG = C:\Program Files\Splunk\etc\apps\search\datetime.xml&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 07:47:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186114#M53607</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-12T07:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186115#M53608</link>
      <description>&lt;P&gt;Try this for your datetime.xml (hopefully markdown will not mangle the text):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;
&amp;lt;define name="_dateFromDirectorySegment" extract="year, month, day"&amp;gt;
&amp;lt;text&amp;gt;&amp;lt;![CDATA[source::.*?(\d{4})(\d{2})(\d{2})]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;define name="_timeFromEventData" extract="hour, minute, second, subsecond"&amp;gt;
&amp;lt;text&amp;gt;&amp;lt;![CDATA[^(\d{2}):(\d{2}:(\d{2}.(\d{3}]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;timePatterns&amp;gt;
&amp;lt;use name="_timeFromEventData"/&amp;gt;
&amp;lt;/timePatterns&amp;gt;
&amp;lt;datePatterns&amp;gt;
&amp;lt;use name="_dateFromDirectorySegment"/&amp;gt;
&amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2015 16:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186115#M53608</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-12T16:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186116#M53609</link>
      <description>&lt;P&gt;in this you not given file path any where&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\Users\T_NiteshS1\Documents\My Received Files\20150511\log2.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is my file path&lt;BR /&gt;
with out given file path how they take date?&lt;/P&gt;

&lt;P&gt;Today i try with file path address that y they not take date&lt;BR /&gt;
ok thanks i try this in office tomorrow &lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 19:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186116#M53609</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-12T19:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186117#M53610</link>
      <description>&lt;P&gt;Yes, I skip over the path because you might change the segment-level (add/remove path segments) so I left is as wildcarded.  This configuration WILL work if you try it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 20:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186117#M53610</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-12T20:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186118#M53611</link>
      <description>&lt;P&gt;I try your answer but they not work after i try many way but fail&lt;BR /&gt;
 itry&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[CDATA[source::.*?\\[My]+\ [Received]+\ [Files]+\\(\d{4})(\d{2})(\d{2})\\[NB92\-Transaction07.log]+]

[CDATA[source::.*?\\(\d{4})(\d{2})(\d{2})\\[NB92\-Transaction07.log]+]

[CDATA[source::.*?\\(\d{4})(\d{2})(\d{2})\\]

[CDATA[source::.*?\\(\d{4})(\d{2})(\d{2})]

[CDATA[source::.*?\My Received Files\(\d{4})(\d{2})(\d{2})]

and so many way i try
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;logfile not contain date logfile present inside folder that folder have date as name&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 08:18:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186118#M53611</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-13T08:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186119#M53612</link>
      <description>&lt;P&gt;The problem is your entry in &lt;CODE&gt;props.conf&lt;/CODE&gt;; it uses a relative path and you have given it a full path.  Use my original &lt;CODE&gt;datetime.xml&lt;/CODE&gt; file and use this in &lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;BR /&gt;
    DATETIME_CONFIG = /etc/apps/search/datetime.xml&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 14:06:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186119#M53612</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-13T14:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186120#M53613</link>
      <description>&lt;P&gt;i used both full address and /etc/apps/search/datetime.xml but they not work&lt;/P&gt;

&lt;P&gt;but when i put datetime.xml in /etc/apps/search/local/datetime.xml then at indexing time &lt;BR /&gt;
splunk not read file give message check sourcetype setting&lt;/P&gt;

&lt;P&gt;when i used /etc/apps/search/datetime.xml they read at indexing time normally&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 17:24:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186120#M53613</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-13T17:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186121#M53614</link>
      <description>&lt;P&gt;when i put date in file name like tran20150511.log&lt;BR /&gt;
and in  datetime.xml seeting for date part i useis: [CDATA[source::.*?tran(\d{4})(\d{2})(\d{2})]]&lt;BR /&gt;
and in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DATETIME_CONFIG = C:\Program Files\Splunk\etc\apps\search\datetimee.xml
EXTRACT-fields = (?&amp;amp;lt;time&amp;amp;gt;\d{2}:\d{2}:\d{2}\.\d{3})\|(?&amp;amp;lt;audit&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;serviceType&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;processId&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;serviceName&amp;amp;gt;[^\|]+)\|(?&amp;amp;lt;indicator&amp;amp;gt;[^\|]+)\|(?P&amp;amp;lt;message&amp;amp;gt;
LINE_BREAKER = ([\r\n]+)\d{2}:\d{2}:\d{2}\.\d{3}\|[^\|]+\|[^\|]+\|[^\|]+\|[^\|]+\|[^\|]+\|
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
category = Custom
disabled = false
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then they take date correctly but&lt;BR /&gt;&lt;BR /&gt;
by folder they not take date&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 09:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186121#M53614</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-15T09:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186122#M53615</link>
      <description>&lt;P&gt;So you have datetime.xml working generally but we cannot get the exat &lt;CODE&gt;text&lt;/CODE&gt; string to do it by path.  That is a good start.  To summarize, your desired path is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\Users\T_NiteshS1\Documents\My Received Files\20150511\log2.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So this line should work (do not worry that it is not fully qualified):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;define name="_dateFromDirectorySegment" extract="year, month, day"&amp;gt;
&amp;lt;text&amp;gt;&amp;lt;![CDATA[source::.*?(\d{4})(\d{2})(\d{2})]]&amp;gt;&amp;lt;/text&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Yes, this is the same thing that I wrote way back in the beginning but I stand by my position that it should work (unless you have copied it by hand and typoed something).&lt;/P&gt;

&lt;P&gt;Do note that the first line is very important because it specifies the order of the captured strings and how they apply to the variables.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2015 15:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186122#M53615</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-15T15:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186123#M53616</link>
      <description>&lt;P&gt;sir i tired this so many time but they not worked&lt;BR /&gt;
i thing some thing is wrong in splunk  to take date from folder name &lt;BR /&gt;
this is bug in spluk possible&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2015 16:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186123#M53616</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-16T16:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: How i set date by log path address ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186124#M53617</link>
      <description>&lt;P&gt;Maybe because you are windows, the problem is the path so instead of this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DATETIME_CONFIG = /etc/apps/search/datetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DATETIME_CONFIG = \etc\apps\search\datetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Aug 2015 00:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-i-set-date-by-log-path-address/m-p/186124#M53617</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-07T00:10:35Z</dc:date>
    </item>
  </channel>
</rss>

