<?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 Having REGEX Problems in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54376#M13276</link>
    <description>&lt;P&gt;Sorry for the cross post but after posting i saw a recommendation to use this forum instead of splunk.com&lt;/P&gt;

&lt;P&gt;I am having issues getting REGEX to work my sample input is a simple two column csv for testing purposes (date,fakeip) the data looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;8/31/2010 12:12:12,1.1.1.1
9/1/2010 12:12:12,1.1.1.1
9/2/2010 12:12:12,1.1.1.1
9/3/2010 12:12:12,1.1.1.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my config files are as follows&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[c_netflowdata]
TRANSFORMS-foo=c_regex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Over the course of the past 8 hours I have tried a large number of different transforms files none which seem to do anything useful so there is obviously something that i am missing from the splunk documentation and peoples examples on this forum below are a few transforms.conf examples that i have tried. The have all produce varying results none of which have resulted in selectable fields in the Search app's field pick'em box&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[c_regex]
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+)
FORMAT=thedate::$1

[c_regex]
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+).*
FORMAT=thedate::$1

[c_regex]
REGEX=[^,],(\d+\.\d+\.\d+\.\d+)    
FORMAT=src_ip::$1

[c_regex]
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+),(\d+\.\d+\.\d+\.\d+)
FORMAT=thedate::$1 src_ip::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have successfully parsed the data using
DELIMS and FIELDS - however there is a specific reason that I am trying to use REGEX - i.e. this is the first step in solving a larger issue that i am trying to address&lt;/P&gt;

&lt;P&gt;Any help is appreciated, thanks in advance&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2010 06:04:54 GMT</pubDate>
    <dc:creator>usersnation</dc:creator>
    <dc:date>2010-09-21T06:04:54Z</dc:date>
    <item>
      <title>Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54376#M13276</link>
      <description>&lt;P&gt;Sorry for the cross post but after posting i saw a recommendation to use this forum instead of splunk.com&lt;/P&gt;

&lt;P&gt;I am having issues getting REGEX to work my sample input is a simple two column csv for testing purposes (date,fakeip) the data looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;8/31/2010 12:12:12,1.1.1.1
9/1/2010 12:12:12,1.1.1.1
9/2/2010 12:12:12,1.1.1.1
9/3/2010 12:12:12,1.1.1.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my config files are as follows&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[c_netflowdata]
TRANSFORMS-foo=c_regex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Over the course of the past 8 hours I have tried a large number of different transforms files none which seem to do anything useful so there is obviously something that i am missing from the splunk documentation and peoples examples on this forum below are a few transforms.conf examples that i have tried. The have all produce varying results none of which have resulted in selectable fields in the Search app's field pick'em box&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[c_regex]
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+)
FORMAT=thedate::$1

[c_regex]
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+).*
FORMAT=thedate::$1

[c_regex]
REGEX=[^,],(\d+\.\d+\.\d+\.\d+)    
FORMAT=src_ip::$1

[c_regex]
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+),(\d+\.\d+\.\d+\.\d+)
FORMAT=thedate::$1 src_ip::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have successfully parsed the data using
DELIMS and FIELDS - however there is a specific reason that I am trying to use REGEX - i.e. this is the first step in solving a larger issue that i am trying to address&lt;/P&gt;

&lt;P&gt;Any help is appreciated, thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54376#M13276</guid>
      <dc:creator>usersnation</dc:creator>
      <dc:date>2010-09-21T06:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54377#M13277</link>
      <description>&lt;P&gt;When you specify your regex using &lt;CODE&gt;TRANSFORMS-&lt;/CODE&gt; in props.conf, this is run at index time and has different properties than search time regexes (specifically, the output needs to be written to &lt;CODE&gt;_meta&lt;/CODE&gt; with &lt;CODE&gt;WRITE_META=true&lt;/CODE&gt;). You can either specify it as &lt;CODE&gt;REPORT-&lt;/CODE&gt; in props.conf, and refer to transforms.conf. It's even easier to specify inline in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[c_netflowdata]
EXTRACT-foo = (?&amp;lt;thedate&amp;gt;\d+/\d+/\d+\s\d+:\d+:\d+),(?&amp;lt;src_ip&amp;gt;\d+\.\d+\.\d+\.\d+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:25:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54377#M13277</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-09-21T06:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54378#M13278</link>
      <description>&lt;P&gt;Yeap, this should work:
[c_regex]&lt;BR /&gt;
REGEX=(\d+/\d+/\d+\s\d+:\d+:\d+)&lt;BR /&gt;
FORMAT=thedate::$1&lt;BR /&gt;
WRITE_META=true  &lt;/P&gt;

&lt;P&gt;Make sure that the data is actually coming in with sourcetype c_netflow.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 06:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54378#M13278</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-09-21T06:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54379#M13279</link>
      <description>&lt;P&gt;Do you really want &lt;CODE&gt;thedate&lt;/CODE&gt; as a field, or is that just an example? If your data has been read in correctly, you should be able to use _time and format it out in any way you want, without using that. Otherwise, see answers below.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 07:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54379#M13279</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-09-21T07:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54380#M13280</link>
      <description>&lt;P&gt;yes thedate is just an example sorry for the confusion&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 20:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54380#M13280</guid>
      <dc:creator>usersnation</dc:creator>
      <dc:date>2010-09-21T20:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54381#M13281</link>
      <description>&lt;P&gt;I haven't attempted REPORT - but EXTRACT gets the job done. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 20:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54381#M13281</guid>
      <dc:creator>usersnation</dc:creator>
      <dc:date>2010-09-21T20:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Having REGEX Problems</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54382#M13282</link>
      <description>&lt;P&gt;then you definitely do not want to use index time extractions&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2010 04:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-REGEX-Problems/m-p/54382#M13282</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2010-09-22T04:51:52Z</dc:date>
    </item>
  </channel>
</rss>

