<?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: Regex to select string from raw data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80330#M20300</link>
    <description>&lt;P&gt;Hi bro try this,&lt;BR /&gt;
[setnull]&lt;BR /&gt;
REGEX = (?i)ancestry.co.uk&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2013 17:57:43 GMT</pubDate>
    <dc:creator>eashwar</dc:creator>
    <dc:date>2013-04-02T17:57:43Z</dc:date>
    <item>
      <title>Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80322#M20292</link>
      <description>&lt;P&gt;Hi I want to extract events that have a specific site name in the raw data. How to extract these events?&lt;/P&gt;

&lt;P&gt;Here are my props.conf and transforms.conf&lt;/P&gt;

&lt;H2&gt;props.conf&lt;/H2&gt;

&lt;P&gt;[iis]&lt;BR /&gt;
TRANSFORMS-set= setnull,setparsing&lt;/P&gt;

&lt;H2&gt;transforms.conf&lt;/H2&gt;

&lt;P&gt;[setnull]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[setparsing]&lt;BR /&gt;
REGEX = (?m)ancestry.com&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = indexQueue&lt;/P&gt;

&lt;P&gt;But the regex does not work. How to set the regex?&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2013 22:21:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80322#M20292</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2013-03-31T22:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80323#M20293</link>
      <description>&lt;P&gt;you want to extract fields in search time or filter data in index time.&lt;BR /&gt;
the above example of props and transforms are not for extracting it is will do the filtering at index time.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 07:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80323#M20293</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-02T07:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80324#M20294</link>
      <description>&lt;P&gt;please give us one sample event so that we can generate you a regular expression to extract the specific site name!!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 07:07:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80324#M20294</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-02T07:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80325#M20295</link>
      <description>&lt;P&gt;eashwar is correct on both counts. &lt;/P&gt;

&lt;P&gt;On a side note, why use a &lt;CODE&gt;(?m)&lt;/CODE&gt; regex for single-line events?&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 12:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80325#M20295</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-02T12:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80326#M20296</link>
      <description>&lt;P&gt;4/2/13&lt;BR /&gt;
10:42:32.000 AM &lt;BR /&gt;
2013-04-02 16:42:32 10.6.15.159 GET /tree/15243411/person/252269850 - 46.33.71.68 Mozilla/5.0+(Windows+NT+5.1)+AppleWebKit/537.31+(KHTML,+like+Gecko)+Chrome/26.0.1410.43+Safari/537.31 HEADER.HINTS.COUNTEXPIRES=2+Apr+2013+16:47:51+UTC;+mbox=PC(referral)|utmcmd=referral|utmcct=/neo/launch;+s_vi=[CS]v1|26DACB7485160BD4-600001A0A03976E2[CE] &lt;A href="http://trees.ancestry.co.uk/tree/15243411/family?cfpid=234793891&amp;amp;selnode=1" target="_blank"&gt;http://trees.ancestry.co.uk/tree/15243411/family?cfpid=234793891&amp;amp;selnode=1&lt;/A&gt; 200 0 0 111279 2839&lt;BR /&gt;
host=TREESUI04   Options|  sourcetype=treesiis   Options|  source=d:\inetpub\logs\W3SVC1\u_ex13040210.log   Options|  date_mday=2&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:39:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80326#M20296</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2020-09-28T13:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80327#M20297</link>
      <description>&lt;P&gt;So above is an event example which has ancestry.co.uk. Other such events might have ancestry.com. I want to extract only those events&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 16:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80327#M20297</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2013-04-02T16:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80328#M20298</link>
      <description>&lt;P&gt;Hello brother,&lt;BR /&gt;&lt;BR /&gt;
you have to correct the way you are asking the question, you have mentioned extract events with the specific word.&lt;BR /&gt;&lt;BR /&gt;
it is clear form your comments that the concept you are trying to perform is &lt;STRONG&gt;FILTERING&lt;/STRONG&gt; of data at &lt;STRONG&gt;INDEX TIME&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;your regex looks good, just omit the (?m) it is not necessary. you feel your regex is not working is because your have added this configurations after you have indexed the data. you have to clean the index and reindex the logs.&lt;/P&gt;

&lt;P&gt;Remove the (?m) from your regex, it is not necessary. actually i dont know what is (?m) i have never used it. you can explain to me in the comment why you have used it.&lt;/P&gt;

&lt;P&gt;Procedure to clean your index and reindex  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;./splunk stop  
./splunk clean eventdata IndexName  
./splunk start
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;now splunk will clean all the data indexed in the specified indexname, and when you start splunk the data will get reindexed and the transforms.conf will apply to the newly indexed data.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Extraction&lt;/STRONG&gt; are done in &lt;STRONG&gt;index time&lt;/STRONG&gt; and &lt;STRONG&gt;search time&lt;/STRONG&gt;. &lt;STRONG&gt;FILTERING is done in INDEX TIME not in Search time&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;i am also a new to splunk.&lt;/P&gt;

&lt;P&gt;if you call a transform.conf variable using &lt;STRONG&gt;REPORT&lt;/STRONG&gt; form props.conf it will do the extraction in &lt;STRONG&gt;search time&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;if you call a transforms.conf variable using &lt;STRONG&gt;TRANSFORMS&lt;/STRONG&gt; from props.conf it will do the &lt;STRONG&gt;extraction or routing or filtering&lt;/STRONG&gt; in index time. &lt;STRONG&gt;you are performing filtering in indextime&lt;/STRONG&gt; it is not extraction  &lt;/P&gt;

&lt;P&gt;try to clean the index and reindex again, dont forget to remove (?m). if you have some specific reason you dant have to remove it, and let me know the reason.&lt;/P&gt;

&lt;P&gt;yours,&lt;BR /&gt;&lt;BR /&gt;
eashwar raghunathan&lt;BR /&gt;&lt;BR /&gt;
happy splunking&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 17:30:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80328#M20298</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-02T17:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80329#M20299</link>
      <description>&lt;P&gt;I am sending the unwanted data to null queue and rest to the index queue. So i tried to follow the splunk documentation that said to do it this way. The regex is where am not sure what exactly to do. I tried putting just ancestry.com but it doesnot do the trick. And am looking at the fresh data not the already indexed data.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 17:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80329#M20299</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2013-04-02T17:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80330#M20300</link>
      <description>&lt;P&gt;Hi bro try this,&lt;BR /&gt;
[setnull]&lt;BR /&gt;
REGEX = (?i)ancestry.co.uk&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 17:57:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80330#M20300</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-02T17:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80331#M20301</link>
      <description>&lt;P&gt;still not working, send me a sample log to &lt;A href="mailto:eashwar@splunkconsultant.com"&gt;eashwar@splunkconsultant.com&lt;/A&gt;. i will get back to you with the configs&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 18:01:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80331#M20301</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-02T18:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to select string from raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80332#M20302</link>
      <description>&lt;P&gt;Hello Bro,&lt;BR /&gt;
the below configs will work for sure. i tested it in my splunk instance.&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .+ancestry\.co\.uk.+
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;dont forget to stop, clean, and start splunk after adding the configs. make sure the props.conf and transforms.conf are in the same local directory.&lt;/P&gt;

&lt;P&gt;if this helped you, dont forget to &lt;STRONG&gt;vote&lt;/STRONG&gt;!!&lt;BR /&gt;&lt;BR /&gt;
yours,&lt;BR /&gt;&lt;BR /&gt;
eashwar raghunathan&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 10:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-select-string-from-raw-data/m-p/80332#M20302</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-04-03T10:39:40Z</dc:date>
    </item>
  </channel>
</rss>

