<?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 create a field with more complicated values to be extracted? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357372#M170070</link>
    <description>&lt;P&gt;@richgalloway I added a letter 'P' right after the question mark and it worked, however it only highlighted the first sample text and did not for the subsequent texts &lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 04:01:14 GMT</pubDate>
    <dc:creator>gilbxrtx_7</dc:creator>
    <dc:date>2018-04-24T04:01:14Z</dc:date>
    <item>
      <title>How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357366#M170064</link>
      <description>&lt;P&gt;I want to extract the &lt;EM&gt;text in square brackets&lt;/EM&gt; to create it as a field. However like my previous problem I had the field extraction error. &lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/240661-field-error-4.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I am new to regular expressions and am not sure on how it is done, would appreciate any help to help me with the regex for this. Thank you.&lt;/P&gt;

&lt;P&gt;Sample of the texts to be used for extraction:&lt;BR /&gt;
&amp;lt;37&amp;gt;1 2018-04-12T02:46:13Z ET0021B747DAEC auth 0  &lt;STRONG&gt;[event101@641 SessionId="34.uUnn74R4Z7DGp" Auth_Method="Username" Username="deleteUser" UniqueUserId="a995a58e-b44f-4ebc-a7f8-f208bb46a692" Fullname="deleteUser"]&lt;/STRONG&gt; Updated group selections for user: 'deleteUser'&lt;/P&gt;

&lt;P&gt;&amp;lt;37&amp;gt;1 2018-04-16T06:03:24Z ET0021B747DAEC settings 0  &lt;STRONG&gt;[event240@641 SessionId="6hbDLUPiY5KfoYaV" SettingName="" Setting_Old_Value="0" Setting_New_Value="1"]&lt;/STRONG&gt; changed id 25464&lt;/P&gt;

&lt;P&gt;&amp;lt;37&amp;gt;1 2018-04-16T06:23:25Z ET0021B747DAEC auth 0  &lt;STRONG&gt;[event243@641 SessionId="U3Ur2rt.7LbzBYHh"]&lt;/STRONG&gt; Session has logged out due to timeout.&lt;/P&gt;

&lt;P&gt;&amp;lt;37&amp;gt;1 2018-04-16T05:47:23Z ET0021B747DAEC jobmanager 0  &lt;STRONG&gt;[event233@641 JobId="9" Job_Type="DataStreamWorkflow"]&lt;/STRONG&gt; Job Cancelled: &lt;/P&gt;

&lt;P&gt;Regardless of the length of the text in square bracket, I would want them to be able to be added as a field. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357366#M170064</guid>
      <dc:creator>gilbxrtx_7</dc:creator>
      <dc:date>2020-09-29T19:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357367#M170065</link>
      <description>&lt;P&gt;Regular expressions aren't that hard, once you get used to them.  A good site for experimenting with regexes is regex101.com.&lt;/P&gt;

&lt;P&gt;This one should work for your sample data.  It looks for a left bracket then takes everything that is not a right bracket and puts it into a field called "squareText".  Of course, you can call the field anything you like.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"\[(?&amp;lt;squareText&amp;gt;[^\]]*)\]"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 03:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357367#M170065</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-04-24T03:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357368#M170066</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "\[(?&amp;lt;bracket_stuff&amp;gt;[^\]]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 03:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357368#M170066</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-24T03:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357369#M170067</link>
      <description>&lt;P&gt;Beat me by 1 minute but I like mine better!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 03:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357369#M170067</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-24T03:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357370#M170068</link>
      <description>&lt;P&gt;thanks for your suggestion, but when I copied and pasted it into regex101.com it stated that the regex got error. I prefer a regex that is meant to be created and stay permanent since I am creating a field, not to search in the search bar&lt;BR /&gt;
when I copied and paste into search bar I dont see any highlighted text either&lt;BR /&gt;
@woodcock&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 03:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357370#M170068</guid>
      <dc:creator>gilbxrtx_7</dc:creator>
      <dc:date>2018-04-24T03:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357371#M170069</link>
      <description>&lt;P&gt;I copied and pasted your suggested regex into regex101.com but it says the following error: incomplete group structure with the (?...) parentheses and question mark. Also I would want the regex that is used for creating fields, not to be entered in search bar &lt;BR /&gt;
When i copied and pasted into search bar I dont see any highlighted text with the square brackets either&lt;BR /&gt;
@richgalloway&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 03:48:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357371#M170069</guid>
      <dc:creator>gilbxrtx_7</dc:creator>
      <dc:date>2018-04-24T03:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357372#M170070</link>
      <description>&lt;P&gt;@richgalloway I added a letter 'P' right after the question mark and it worked, however it only highlighted the first sample text and did not for the subsequent texts &lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 04:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357372#M170070</guid>
      <dc:creator>gilbxrtx_7</dc:creator>
      <dc:date>2018-04-24T04:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357373#M170071</link>
      <description>&lt;P&gt;Hai ,&lt;/P&gt;

&lt;P&gt;Use the below regex syntax.&lt;/P&gt;

&lt;P&gt;you will exactly get the data in square bracket. I have tested with above sample data provided by you.&lt;/P&gt;

&lt;P&gt;[[a-zA-Z0-9@="-._\s\]*&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 11:01:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357373#M170071</guid>
      <dc:creator>Shan</dc:creator>
      <dc:date>2018-04-24T11:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357374#M170072</link>
      <description>&lt;P&gt;You tested it wrong; see here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/npR95w/1"&gt;https://regex101.com/r/npR95w/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You can save this as a permanent KO by going to &lt;CODE&gt;Settings&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Fields&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;Field extractions&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;New&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 15:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357374#M170072</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-24T15:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a field with more complicated values to be extracted?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357375#M170073</link>
      <description>&lt;P&gt;@gilbxrtx_7  - You have multiple correct answers. Kindly test it. Accept the answer and close the question..   &lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 04:57:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-field-with-more-complicated-values-to-be/m-p/357375#M170073</guid>
      <dc:creator>Shan</dc:creator>
      <dc:date>2018-04-25T04:57:32Z</dc:date>
    </item>
  </channel>
</rss>

