<?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: rex field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349217#M170203</link>
    <description>&lt;P&gt;rex field=_raw "Eex for account(s):\s+(?[^,]+)" &lt;/P&gt;</description>
    <pubDate>Wed, 18 Apr 2018 16:54:32 GMT</pubDate>
    <dc:creator>swetasoneji</dc:creator>
    <dc:date>2018-04-18T16:54:32Z</dc:date>
    <item>
      <title>rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349216#M170202</link>
      <description>&lt;P&gt;How would I extract account number here,&lt;/P&gt;

&lt;P&gt;message:Receiving exp from: Long URL  /Eex  for account(s): 8768&lt;/P&gt;

&lt;P&gt;rex field=_raw "Exposure for account(s):\s+(?[^,]+)" &lt;/P&gt;

&lt;P&gt;It neither brings result nor error.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349216#M170202</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-18T16:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349217#M170203</link>
      <description>&lt;P&gt;rex field=_raw "Eex for account(s):\s+(?[^,]+)" &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:54:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349217#M170203</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-18T16:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349218#M170204</link>
      <description>&lt;P&gt;Try using the code &lt;CODE&gt;101010&lt;/CODE&gt; button or wrapping your rex command with backticks.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:57:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349218#M170204</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-18T16:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349219#M170205</link>
      <description>&lt;P&gt;can you please elaborate? I'm fairly new to splunk &lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 16:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349219#M170205</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-18T16:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349220#M170206</link>
      <description>&lt;P&gt;Sure! This isn't a Splunk thing per se, but rather more about how to post your question here. It looks like part of your rex command is getting eaten up by the formatting here, so it's hard to diagnose. &lt;/P&gt;

&lt;P&gt;When you post code, it's best to click the button that looks like &lt;CODE&gt;101010&lt;/CODE&gt; so that your code can be escaped and all characters preserved. If you can't find that button, you can use a single backtick (the character at the top left of your keyboard, on the same key as the &lt;CODE&gt;~&lt;/CODE&gt; tilde) before and after your code.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 17:09:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349220#M170206</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-18T17:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349221#M170207</link>
      <description>&lt;P&gt;@swetasoneji, following is a run anywhere search based on the sample data to fetch account.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="message:Receiving exp from: Long URL /Eex for account(s): 8768"
| rex "\/Eex for account\(s\):\s(?&amp;lt;accounts&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Based on your data and partial rex seems like if there are multiple accounts they would be comma separated. Can you please add another sample for multiple accounts?&lt;/P&gt;

&lt;P&gt;You can try the following run anywhere search if multiple accounts are comma separated.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="message:Receiving exp from: Long URL /Eex for account(s): 8768.8851,8423"
| rex "\/Eex for account\(s\):\s(?&amp;lt;accounts&amp;gt;.*)"
| makemv accounts delim=","
| mvexpand accounts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the like from regex101.com for you to test regular expression with your sample data and alsi understand how regular expression is working: &lt;A href="https://regex101.com/r/m1dGQZ/1"&gt;https://regex101.com/r/m1dGQZ/1&lt;/A&gt;&lt;BR /&gt;
While posting sample data or Code here on Splunk Answers you can click the code button which looks like &lt;CODE&gt;101010&lt;/CODE&gt;, you can also try shortcut CTRL+K after highlighting the code/data, or in worst case press an enter before typing the code and add four spaces before every line of the code/data to enable code section. If you do not do the same special characters will get escaped.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 17:49:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349221#M170207</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-18T17:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349222#M170208</link>
      <description>&lt;P&gt;Your message sample says /Eex, your regex starts with "Exposure". Is that just a typo or so in your sample, otherwise that could be one of the issues.&lt;/P&gt;

&lt;P&gt;Also:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;If you want to actually match a &lt;CODE&gt;(&lt;/CODE&gt; character, you need to escape it&lt;/LI&gt;
&lt;LI&gt;your capturing group needs to be named, such that it will get put into a field&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;To keep it simple (you can enhance it if you need), something like this should  work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "account\(s\):\s+(?&amp;lt;account_number&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See also: &lt;A href="https://regex101.com/r/ELFlV3/1"&gt;https://regex101.com/r/ELFlV3/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 17:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349222#M170208</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-04-18T17:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349223#M170209</link>
      <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;

&lt;P&gt;This worked | rex field=_raw "account(s):\s+(?\d+)"&lt;/P&gt;

&lt;P&gt;But let's if I've multiple accounts here..7293,7243BMKTL, 8987,5787JHR&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 09:29:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349223#M170209</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-19T09:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349224#M170210</link>
      <description>&lt;P&gt;@swetasoneji, have you tried the answer above with run anywhere example?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 09:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349224#M170210</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-19T09:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349225#M170211</link>
      <description>&lt;P&gt;What do you want to do with multiple account numbers? Take the first one? Take them all and make it a multi value field?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 09:51:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349225#M170211</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-04-19T09:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349226#M170212</link>
      <description>&lt;P&gt;Manage to work it up:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/ELFlV3/1"&gt;https://regex101.com/r/ELFlV3/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks all for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 10:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349226#M170212</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-19T10:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349227#M170213</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;What are doing it's correct you must juste add \ to ( like n\(s\), and add name of field extract like &lt;CODE&gt;?\&amp;lt;accounts\&amp;gt;&lt;/CODE&gt;, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="message:Receiving exp from: Long URL /Eex for account(s): 8768"
| rex field=_raw "Eex for account\(s\):\s+(?&amp;lt;accounts&amp;gt;[^,]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Apr 2018 10:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349227#M170213</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-19T10:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349228#M170214</link>
      <description>&lt;P&gt;I'm actually trying to do this.&lt;BR /&gt;
&lt;A href="https://regex101.com/r/ELFlV3/1"&gt;https://regex101.com/r/ELFlV3/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I want to only take accounts. Don't want take any text after that.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 11:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349228#M170214</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-19T11:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349229#M170215</link>
      <description>&lt;P&gt;You can test directly in Splunk, that take only number not texte, copie and past all the request in Search bar &lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349229#M170215</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-19T12:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349230#M170216</link>
      <description>&lt;P&gt;this doesn't fit with the search I'm using it.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/ELFlV3/1"&gt;https://regex101.com/r/ELFlV3/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But don't want anything from sample test run.&lt;/P&gt;

&lt;P&gt;Result should be:8768,789JRH,789JRH,789JRH,7854JRH&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349230#M170216</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-19T12:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349231#M170217</link>
      <description>&lt;P&gt;how to make multi value field&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349231#M170217</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-19T12:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349232#M170218</link>
      <description>&lt;P&gt;&lt;A href="https://regex101.com/r/ELFlV3/1"&gt;https://regex101.com/r/ELFlV3/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Don't want to take sample test run in my result:&lt;/P&gt;

&lt;P&gt;Final result would be 8768,789JRH,789JRH,789JRH,7854JRH&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349232#M170218</guid>
      <dc:creator>swetasoneji</dc:creator>
      <dc:date>2018-04-19T12:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349233#M170219</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;To take a multivalues, you can use makemv and mvexpand command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
     | eval _raw="message:Receiving exp from: Long URL /Eex for account(s): 7293,7243BMKTL, 8987,5787JHR"
     | rex field=_raw "Eex for account\(s\):\s+(?&amp;lt;accounts&amp;gt;.*)"
| makemv delim="," accounts
| mvexpand accounts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If that'd work please accept the anwser to help another person with some problem&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:19:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349233#M170219</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-19T12:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349234#M170220</link>
      <description>&lt;P&gt;It sounds like your event might have more data after the account number(s). Can you paste a full sample event, so that we can help you figure out how to extract all account numbers but not the text after the accounts?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 14:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349234#M170220</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-19T14:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349235#M170221</link>
      <description>&lt;P&gt;Yes, its easy this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
      | eval _raw="message:Receiving exp from: Long URL /Eex for account(s): 7293,7243BMKTL, 8987,5787JHR"
      | rex field=_raw "Eex for account\(s\):\s+(?&amp;lt;accounts&amp;gt;.*)"
 | makemv delim="," accounts
 | mvexpand accounts
| rex field=accounts "(?\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Apr 2018 14:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-field-extraction/m-p/349235#M170221</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-19T14:30:16Z</dc:date>
    </item>
  </channel>
</rss>

