<?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 write regex to extract three digit numbers from a CSV file and assign the values to a new field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129450#M35213</link>
    <description>&lt;P&gt;Thanks MuS, it worked now.&lt;BR /&gt;
actually i specified  field in my query earlier, but it was not displayed in my query above:)&lt;/P&gt;</description>
    <pubDate>Thu, 18 Sep 2014 06:51:41 GMT</pubDate>
    <dc:creator>karthikTIL</dc:creator>
    <dc:date>2014-09-18T06:51:41Z</dc:date>
    <item>
      <title>How to write regex to extract three digit numbers from a CSV file and assign the values to a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129446#M35209</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;I have source file test.csv which has words like "abc-234    "   , "456",  "df 654",  "er567   -ly".&lt;BR /&gt;
In all the above words, i want to take only three digit numbers and assign to a field called "eng".&lt;BR /&gt;
Please let me know how would be the regular expression would be?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 04:57:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129446#M35209</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2014-09-18T04:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract three digit numbers from a CSV file and assign the values to a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129447#M35210</link>
      <description>&lt;P&gt;Hi karthikTIL,&lt;/P&gt;

&lt;P&gt;use something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here | rex "(?&amp;lt;eng&amp;gt;\d{3})" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 05:49:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129447#M35210</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-18T05:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract three digit numbers from a CSV file and assign the values to a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129448#M35211</link>
      <description>&lt;P&gt;HI MuS,&lt;/P&gt;

&lt;P&gt;sorry, i forgot to add.&lt;BR /&gt;
All my words occur after "Title #:"&lt;BR /&gt;
e.g. Title #: df 654&lt;/P&gt;

&lt;P&gt;so i used,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your base search here | rex "Title #:(?\d{3})" | ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;but it did not give any result&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 05:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129448#M35211</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2014-09-18T05:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract three digit numbers from a CSV file and assign the values to a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129449#M35212</link>
      <description>&lt;P&gt;Sure this will not work, because this regex does not match and you did not specify a field name for the group.&lt;BR /&gt;
Why didn't you try the regex I provided? This will catch all 3 digit numbers, no matter what comes before or after.&lt;BR /&gt;
But if you really need to match only the &lt;CODE&gt;Title #:&lt;/CODE&gt; numbers use something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here | rex "Title\s\#\:[\s\w\-]+(?&amp;lt;eng&amp;gt;\d{3})" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and please don't use &lt;CODE&gt;your base search here&lt;/CODE&gt; as your search, this is only a place holder &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 06:17:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129449#M35212</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-18T06:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract three digit numbers from a CSV file and assign the values to a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129450#M35213</link>
      <description>&lt;P&gt;Thanks MuS, it worked now.&lt;BR /&gt;
actually i specified  field in my query earlier, but it was not displayed in my query above:)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 06:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129450#M35213</guid>
      <dc:creator>karthikTIL</dc:creator>
      <dc:date>2014-09-18T06:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to write regex to extract three digit numbers from a CSV file and assign the values to a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129451#M35214</link>
      <description>&lt;P&gt;you're welcome. please mark this as answered if the provided answer was correct - thx&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2014 06:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-regex-to-extract-three-digit-numbers-from-a-CSV/m-p/129451#M35214</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-18T06:53:55Z</dc:date>
    </item>
  </channel>
</rss>

