<?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: creating a _masheddate3 in datetime.xml in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14422#M1536</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;
C:\Users\T_NiteshS1\Documents\My Received Files\20150511\log2.log&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;

&lt;P&gt;I try many way but fail&lt;BR /&gt;
my try&lt;BR /&gt;
[CDATA[source::.*?\[My]+\ [Received]+\ [Files]+\(\d{4})(\d{2})(\d{2})\[NB92-Transaction07.log]+]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\(\d{4})(\d{2})(\d{2})\[NB92-Transaction07.log]+]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\(\d{4})(\d{2})(\d{2})\]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\(\d{4})(\d{2})(\d{2})]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\My Received Files(\d{4})(\d{2})(\d{2})]&lt;/P&gt;

&lt;P&gt;and so many way i try&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2015 09:30:09 GMT</pubDate>
    <dc:creator>nitesh218ss</dc:creator>
    <dc:date>2015-05-13T09:30:09Z</dc:date>
    <item>
      <title>creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14413#M1527</link>
      <description>&lt;P&gt;This is a question stemmed from &lt;A href="http://answers.splunk.com/questions/2996/strptime-format-for-yyyymmddhhmmss" rel="nofollow"&gt;http://answers.splunk.com/questions/2996/strptime-format-for-yyyymmddhhmmss&lt;/A&gt; and &lt;A href="http://answers.splunk.com/questions/2831/index-on-regex-field-from-source" rel="nofollow"&gt;http://answers.splunk.com/questions/2831/index-on-regex-field-from-source&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;my event source looks like this ".../scripts/&lt;STRONG&gt;201005271243&lt;/STRONG&gt;/data/file.txt".&lt;/P&gt;

&lt;P&gt;End goal is to parse the date from the source.&lt;/P&gt;

&lt;P&gt;I have copied the datetime.xml file to myapp/default dir.&lt;/P&gt;

&lt;P&gt;i have modified props.conf to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
DATETIME_CONFIG = /opt/splunk/etc/apps/myapp/default/datetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i have modified datetime.xml to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;define name="_masheddate3" extract="year, month, day, hour, minute"&amp;gt;
    &amp;lt;text&amp;gt;&amp;lt;![CDATA[(?:^|source::).*\/scripts\/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})\/data.*]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as well as the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datePatterns&amp;gt;&amp;lt;use name="_masheddate3"/&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...to no avail.   Index doesn't seem to populate at all. &lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 23:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14413#M1527</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-27T23:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14414#M1528</link>
      <description>&lt;P&gt;i suspect the regex to be incorrect.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 01:03:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14414#M1528</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-28T01:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14415#M1529</link>
      <description>&lt;P&gt;Well, your regex does seem to work, however, you may want to tweak it to (1) only match &lt;CODE&gt;source::&lt;/CODE&gt; patterns, although you have enough other path-like matching it's unlikely to match else where, and (2) remove the unnecessary escaping for &lt;CODE&gt;/&lt;/CODE&gt;, but I'm not sure that would cause you a problem.&lt;/P&gt;

&lt;P&gt;I'd suggest, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;text&amp;gt;&amp;lt;![CDATA[source::.*?/scripts/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/data/]]&amp;gt;&amp;lt;/text&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also dropped off the &lt;CODE&gt;.*&lt;/CODE&gt; from the end since the other rules don't have any such matching at the end.  I also replaced your &lt;CODE&gt;.*&lt;/CODE&gt; at the front with the non-greedy &lt;CODE&gt;.*?&lt;/CODE&gt; which, should help performance.&lt;/P&gt;

&lt;P&gt;Hmmm, I think this could be your problem....  Your &lt;CODE&gt;_masheddate3&lt;/CODE&gt; is contains not only a date but also a time.  It looks like &lt;CODE&gt;_combdatetime&lt;/CODE&gt; for example, is setup in both the &lt;CODE&gt;timePatterns&lt;/CODE&gt; listing as well as the &lt;CODE&gt;datePatterns&lt;/CODE&gt;.  So if you don't have your entry in both, then I'd give that a try.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 03:07:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14415#M1529</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-28T03:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14416#M1530</link>
      <description>&lt;P&gt;how do i know if it failed.. other than finding the index did not populate?  is an error in _internal ?&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 03:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14416#M1530</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-28T03:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14417#M1531</link>
      <description>&lt;P&gt;Ah hah! "Can't open DatePaser XML configuration file ...datetime.xml" No such file or directory.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 03:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14417#M1531</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-28T03:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14418#M1532</link>
      <description>&lt;P&gt;bad path to datetime.xml&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 04:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14418#M1532</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-28T04:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14419#M1533</link>
      <description>&lt;P&gt;lol.   Sometimes it's the simple things that take the most time to find.  (I've been there many many times).  Good catch.  Hey, let me know about the whole time/date Patterns thing, does it make a difference?&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 04:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14419#M1533</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-28T04:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14420#M1534</link>
      <description>&lt;P&gt;You do need to list the name of your rule in both the &lt;CODE&gt;datePatterns&lt;/CODE&gt; and &lt;CODE&gt;timePatterns&lt;/CODE&gt; part of the &lt;CODE&gt;datetime.xml&lt;/CODE&gt; if you want it to get both date and time. It's okay to list the same rule in both places.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 06:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14420#M1534</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-05-28T06:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14421#M1535</link>
      <description>&lt;P&gt;I added it to both time and date   .. still no go.   Seems to still run off of the last modified date.    New question... &lt;A href="http://answers.splunk.com/questions/3102/datetime-xml-change-doesnt-seem-to-be-working"&gt;http://answers.splunk.com/questions/3102/datetime-xml-change-doesnt-seem-to-be-working&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2010 23:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14421#M1535</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2010-05-28T23:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: creating a _masheddate3 in datetime.xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14422#M1536</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;
C:\Users\T_NiteshS1\Documents\My Received Files\20150511\log2.log&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;

&lt;P&gt;I try many way but fail&lt;BR /&gt;
my try&lt;BR /&gt;
[CDATA[source::.*?\[My]+\ [Received]+\ [Files]+\(\d{4})(\d{2})(\d{2})\[NB92-Transaction07.log]+]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\(\d{4})(\d{2})(\d{2})\[NB92-Transaction07.log]+]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\(\d{4})(\d{2})(\d{2})\]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\(\d{4})(\d{2})(\d{2})]&lt;/P&gt;

&lt;P&gt;[CDATA[source::.*?\My Received Files(\d{4})(\d{2})(\d{2})]&lt;/P&gt;

&lt;P&gt;and so many way i try&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 09:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/creating-a-masheddate3-in-datetime-xml/m-p/14422#M1536</guid>
      <dc:creator>nitesh218ss</dc:creator>
      <dc:date>2015-05-13T09:30:09Z</dc:date>
    </item>
  </channel>
</rss>

