<?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: I need help finding a substring and setting it to display in a new field. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198291#M57328</link>
    <description>&lt;P&gt;Your problem might be a case issue.  orderid does not equal OrderID  Fields are case sensitive.&lt;BR /&gt;
I've retested and it works fine for me...&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2014 18:06:48 GMT</pubDate>
    <dc:creator>lukejadamec</dc:creator>
    <dc:date>2014-01-08T18:06:48Z</dc:date>
    <item>
      <title>I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198277#M57314</link>
      <description>&lt;P&gt;I am sure this is probably a noob question, but I am a noob and I have been researching this for a while this morning and am not having any luck. Maybe you can help!&lt;/P&gt;

&lt;P&gt;Ok, I am pulling a query from a log file that returns a random string of text such as:&lt;/P&gt;

&lt;P&gt;xxxxxxxxxxxxxxxxxxxxxxxxxx11=123456xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lt;/P&gt;

&lt;P&gt;What I would like to do is take that 11= value and set it to a new field called OrderID, whereas the 123456 which just show up in the order ID field. Any help or insight on this would be great!&lt;/P&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:30:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198277#M57314</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T16:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198278#M57315</link>
      <description>&lt;P&gt;Are the xxx's for real?  Is the value always preceded by 11=?  Is the value always a number?  What is the name of the field that contains the random string of text?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198278#M57315</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T16:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198279#M57316</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm not sure what you wan't&lt;/P&gt;

&lt;P&gt;If you wan't a field OrderID with a value "11=123456"&lt;BR /&gt;
I would make something like &lt;BR /&gt;
    | rex "(?P&lt;ORDERID&gt;\d*\=\d*)"&lt;/ORDERID&gt;&lt;/P&gt;

&lt;P&gt;I you need a field 11, that has a value 123456, I don't know&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:38:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198279#M57316</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2014-01-08T16:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198280#M57317</link>
      <description>&lt;P&gt;sorry! ok the xxxx's are just to represent the random text that may precede or follow the 11= value. yes the value is always preceded by 11=. For the sake of simplicity and my understanding lets just say it is always a number. This text is just being pulled from the _raw field.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198280#M57317</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T16:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198281#M57318</link>
      <description>&lt;P&gt;Try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch |rex ".*[1][1]=(?P&amp;lt;orderID&amp;gt;\d+)\D"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should create a field from &lt;CODE&gt;_raw&lt;/CODE&gt; named orderID.&lt;/P&gt;

&lt;P&gt;Explaination:&lt;BR /&gt;&lt;BR /&gt;
rex used without a field= will extract from &lt;CODE&gt;_raw&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;
The expression needs to be enclosed in quotes.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;.*&lt;/CODE&gt; means any sequence of characters or symbols.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;[1][1]&lt;/CODE&gt; means exactly the number 11&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;=&lt;/CODE&gt; is not a regular expression, so it is not escaped and means exactly the symbol &lt;CODE&gt;=&lt;/CODE&gt;.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;(?P&amp;lt;orderid&amp;gt;\d+)&lt;/CODE&gt; is the capture group.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;?&lt;/CODE&gt; means not lazy, or grab the first occurance.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;P&lt;/CODE&gt; stands for pull the value and name it orderid.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&amp;lt;orderid&amp;gt;&lt;/CODE&gt; sets field name for the extracted value, in this case we're going to call it orderid.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;\d+&lt;/CODE&gt; means one or more digit.  So, what we have so far is, grab one or more digits after 11= as value for the field orderid.&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;\D&lt;/CODE&gt; means not a digit.  So, it says stop grabbing digits for the value when a non-digit is encountered.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:45:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198281#M57318</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T16:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198282#M57319</link>
      <description>&lt;P&gt;thanks, I am ok on the understanding of creating a new field, what I am having trouble with is taking the 11=123465 and then just returning 123456 in that OrderID field.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:50:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198282#M57319</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T16:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198283#M57320</link>
      <description>&lt;P&gt;sorry! to clarify, I would like to find the "11=123456" and then just return the 123456 in the OrderID field. The 123456 is just for example, this could be any random number following the "11="&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198283#M57320</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T16:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198284#M57321</link>
      <description>&lt;P&gt;The above code should do it.  It grabs the value after the = and puts it in a new field called orderID.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:54:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198284#M57321</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T16:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198285#M57322</link>
      <description>&lt;P&gt;doesnt seem to work, it is creating a new field called OrderID, but it is coming up empty! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;This is my search: search ErrorMessage | rex ".*\d\d=(?P&lt;ORDERID&gt;\d+)\D" | table OrderID&lt;/ORDERID&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:07:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198285#M57322</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T17:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198286#M57323</link>
      <description>&lt;P&gt;I updated the code so it specifically looks for "11=" and grabs the value after that.  It will stop grabbing numbers when it hits a non-digit, and it assumes there are no spaces between the = and the value you're after.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:07:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198286#M57323</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T17:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198287#M57324</link>
      <description>&lt;P&gt;hmm, I tried again with updated code and still doesnt seem to pull the number, still just seeing an empty OrderID field. I am fairly new to using splunk, so it's probably user error, but I just tried with: search ErrorMessage | rex ".*[1][1]=(?P&lt;ORDERID&gt;\d+)\D" | table OrderID&lt;/ORDERID&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:16:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198287#M57324</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T17:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198288#M57325</link>
      <description>&lt;P&gt;thaks so much for your help, any other thoughts on why its not working for me? Again, this is my query: search ErrorMessage | rex ".*[1][1]=(?P&lt;ORDERID&gt;d+)D" | table OrderID&lt;/ORDERID&gt;&lt;/P&gt;

&lt;P&gt;but the OrderID field is just showing as blank...&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:44:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198288#M57325</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T17:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198289#M57326</link>
      <description>&lt;P&gt;Is the 11= showing up anywhere else? &lt;BR /&gt;
Can you post a the `_raw' output from one of the events?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198289#M57326</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T17:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198290#M57327</link>
      <description>&lt;P&gt;this is piece of the raw output where the 11= shows, and no other 11= are in here&lt;/P&gt;

&lt;P&gt;\x150=ABCD\x1128=ABCD\x11=73563269\x155=ABCD\x154=1&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198290#M57327</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T17:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198291#M57328</link>
      <description>&lt;P&gt;Your problem might be a case issue.  orderid does not equal OrderID  Fields are case sensitive.&lt;BR /&gt;
I've retested and it works fine for me...&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 18:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198291#M57328</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T18:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198292#M57329</link>
      <description>&lt;P&gt;Try:&lt;BR /&gt;
&lt;CODE&gt;search ErrorMessage | rex ".*[1][1]=(?P&amp;lt;orderid&amp;gt;d+)D" | table orderid&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 18:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198292#M57329</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-08T18:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198293#M57330</link>
      <description>&lt;P&gt;still no luck, but I am working on it, thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 18:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198293#M57330</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-08T18:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198294#M57331</link>
      <description>&lt;P&gt;I feel like I am just missing something simple, can you break down this part ".*[1][1]=(?P&lt;ORDERID&gt;d+)D" and tell me exactly what each part is doing? I have a general understanding but maybe your explanation might clear things up for me!&lt;/ORDERID&gt;&lt;/P&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:21:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198294#M57331</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-09T16:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198295#M57332</link>
      <description>&lt;P&gt;Some how an error was introduced from the original formula.  It is missing slashes and should be:&lt;BR /&gt;
&lt;CODE&gt;search ErrorMessage | rex ".*[1][1]=(?P&amp;lt;orderid&amp;gt;\d+)\D" | table orderid&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198295#M57332</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-09T16:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: I need help finding a substring and setting it to display in a new field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198296#M57333</link>
      <description>&lt;P&gt;THAT WORKED! Thanks so much you are awesome! Also, I greatly appreciate you taking the time to provide explanation, this is all very helpful to a Splunk noob like myslef!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2014 16:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-help-finding-a-substring-and-setting-it-to-display-in-a/m-p/198296#M57333</guid>
      <dc:creator>dlespron</dc:creator>
      <dc:date>2014-01-09T16:55:38Z</dc:date>
    </item>
  </channel>
</rss>

