<?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 do I extract a field from my raw data using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116851#M31057</link>
    <description>&lt;P&gt;Hi @MuS, that's great, thank you.&lt;/P&gt;

&lt;P&gt;Kind Regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2015 08:51:30 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2015-07-13T08:51:30Z</dc:date>
    <item>
      <title>How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116845#M31051</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I wonder whether someone may be able to help me please.&lt;/P&gt;

&lt;P&gt;I'm very new to using Splunk and most certainly to the &lt;CODE&gt;rex&lt;/CODE&gt; command and regular expressions, so please bear with.&lt;/P&gt;

&lt;P&gt;I'm trying to extract a &lt;CODE&gt;nino&lt;/CODE&gt; field from my raw data which is in the following format &lt;CODE&gt;"nino\":\"AB123456B\"&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Could someone possibly tell me please how I may strip the actual nino number out of this line.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 06:15:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116845#M31051</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-13T06:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116846#M31052</link>
      <description>&lt;P&gt;Hi IRHM73,&lt;/P&gt;

&lt;P&gt;if your &lt;CODE&gt;_raw&lt;/CODE&gt; events really contains the provided example , you can run this &lt;CODE&gt;rex&lt;/CODE&gt; command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base reach here | rex field=_raw ":\\"(?&amp;lt;nino&amp;gt;\w+)\\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will match every &lt;CODE&gt;match any word character [a-zA-Z0-9_]&lt;/CODE&gt; after &lt;CODE&gt;:\"&lt;/CODE&gt; and puts is into the field called &lt;CODE&gt;nino&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 07:41:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116846#M31052</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T07:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116847#M31053</link>
      <description>&lt;P&gt;Hi @MuS, thank you very much for taking the time to reply to my post.&lt;/P&gt;

&lt;P&gt;Unfortunately I can't get this to work, because it returns the error message: Error in 'rex' command: Encountered the following error while compiling the regex ':(?w+)': Regex: unmatched parentheses.&lt;/P&gt;

&lt;P&gt;Could you also tell me please, is it possible to search for the field 'nino' specifically because my raw data contains a number of fields with the same "fieldname":"fieldvalue" format.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 07:51:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116847#M31053</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-13T07:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116848#M31054</link>
      <description>&lt;P&gt;Sorry my bad, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base reach here | rex field=_raw ":\\\"(?&amp;lt;nino&amp;gt;\w+)\\\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or take a look at this answer to answer your second question &lt;A href="http://answers.splunk.com/answers/214487/can-i-extract-a-field-with-a-regexed-dynamic-field.html"&gt;http://answers.splunk.com/answers/214487/can-i-extract-a-field-with-a-regexed-dynamic-field.html&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 08:28:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116848#M31054</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T08:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116849#M31055</link>
      <description>&lt;P&gt;Hi, that's great thank you very much, but could you tell me please how I search for the 'nino' field.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Could you also tell me please, is it  possible to search for the field 'nino' specifically because my raw data contains a number of fields with the same "fieldname":"fieldvalue" format.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 08:39:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116849#M31055</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-13T08:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116850#M31056</link>
      <description>&lt;P&gt;Just add any search or stats command in the next search pipe like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base reach here | rex field=_raw ":\\\"(?&amp;lt;nino&amp;gt;\w+)\\\"" | table nino
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base reach here | rex field=_raw ":\\\"(?&amp;lt;nino&amp;gt;\w+)\\\"" | search nino=AB*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jul 2015 08:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116850#M31056</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T08:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116851#M31057</link>
      <description>&lt;P&gt;Hi @MuS, that's great, thank you.&lt;/P&gt;

&lt;P&gt;Kind Regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 08:51:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116851#M31057</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-13T08:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116852#M31058</link>
      <description>&lt;P&gt;You're welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 08:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116852#M31058</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T08:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116853#M31059</link>
      <description>&lt;P&gt;Hi, every one,&lt;BR /&gt;
how can we use rex  field=_raw   in an input field ? I couldn't make it correctley &lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 09:00:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116853#M31059</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-07-13T09:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116854#M31060</link>
      <description>&lt;P&gt;I suggest to open a new question and provide more details&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 09:03:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116854#M31060</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T09:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116855#M31061</link>
      <description>&lt;P&gt;Hi, @MuS, I'm really very sorry to trouble you with this again.&lt;/P&gt;

&lt;P&gt;I've used the 'rex' expression you kindly provided, but unfortunately it doesn't extract the correct data into the table. I've also tried anothe field called 'middleNames' which has the same format as the NINO, so the expression is rex field=_raw ":"(?w+)"" | table middleNames, but it is still not extracting the field value data from the raw text.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 09:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116855#M31061</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-13T09:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116856#M31062</link>
      <description>&lt;P&gt;please provide some raw event for both fields, use the code mark up CTRL-K to encode any special characters ...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 09:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116856#M31062</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T09:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116857#M31063</link>
      <description>&lt;P&gt;Hi @Mus, thank you for coming back to me with this.&lt;/P&gt;

&lt;P&gt;Unfortunately, due to it's sensitive data, I can't send you the raw data, but perhaps if you could explain, what you need I may be able to put something together.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 09:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116857#M31063</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-13T09:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116858#M31064</link>
      <description>&lt;P&gt;This should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "nino[\\\":]*(?&amp;lt;nino&amp;gt;[^\\\":]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jul 2015 15:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116858#M31064</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-13T15:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116859#M31065</link>
      <description>&lt;P&gt;Hi there, it is currently not 100% clear if the event looks like this &lt;CODE&gt;nino":"AB123456B"&lt;/CODE&gt; or like this &lt;CODE&gt;nino\":\"AB123456B\"&lt;/CODE&gt; can you please confirm if it is either the first or the later one?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 21:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116859#M31065</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T21:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116860#M31066</link>
      <description>&lt;P&gt;Hi @MuS, thank you for coming back to me with this I really appreciate it. The format of the nino field was &lt;CODE&gt;"nino\":\"AB123456B\".&lt;/CODE&gt; But not to worry I've been able to extrcat this using the solution  by @woodcock.&lt;/P&gt;

&lt;P&gt;Once again sincere thanks for your help.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2015 06:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116860#M31066</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-14T06:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116861#M31067</link>
      <description>&lt;P&gt;Hi @woodcock, thank you for taking the time to reply to my post, this works great.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2015 06:45:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116861#M31067</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-07-14T06:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116862#M31068</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm trying to achieve the something similar using regular expressions on raw data...&lt;/P&gt;

&lt;P&gt;I want to extract the figures at the end of row ESS1. if some-one could help me extract the field and strip out the figures would be great!&lt;/P&gt;

&lt;P&gt;ESCO              -   [57]&lt;BR /&gt;
ESDC              -   [82]&lt;BR /&gt;
ESEM              -   [170]&lt;BR /&gt;
ESS1              -   [2813]&lt;BR /&gt;
ESVI              -   [706]&lt;BR /&gt;
F421              -   [30]&lt;/P&gt;

&lt;P&gt;Thanks &lt;BR /&gt;
Bablucho&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116862#M31068</guid>
      <dc:creator>bablucho</dc:creator>
      <dc:date>2018-10-18T13:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116863#M31069</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex "ESS1 - \[(?&amp;lt;thatfield&amp;gt;[^\]]+)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will create a field called &lt;CODE&gt;thatfield&lt;/CODE&gt; with the value &lt;CODE&gt;2813&lt;/CODE&gt; based on your provided example.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 19:04:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116863#M31069</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-10-18T19:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract a field from my raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116864#M31070</link>
      <description>&lt;P&gt;Thanks MuS I think this would work though I've just realised when raw data I pasted in didn't include the whites spaces...&lt;/P&gt;

&lt;P&gt;ESCO - [57]&lt;BR /&gt;
ESDC - [82]&lt;BR /&gt;
ESEM - [170]&lt;BR /&gt;
ESS1{14whitespaces}-{3whitespaces} [2813]&lt;BR /&gt;
ESVI - [706]&lt;BR /&gt;
F421 - [30]&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 08:11:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-a-field-from-my-raw-data-using-rex/m-p/116864#M31070</guid>
      <dc:creator>bablucho</dc:creator>
      <dc:date>2018-10-19T08:11:47Z</dc:date>
    </item>
  </channel>
</rss>

