<?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: Regex to extract field: data inside a a parenthesis in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496151#M84636</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=user_description "\((?P&amp;amp;lt;result&amp;amp;gt;[^)]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 May 2020 11:36:43 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2020-05-12T11:36:43Z</dc:date>
    <item>
      <title>Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496142#M84627</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I would like to extract data from inside a parenthesis to create a new field&lt;BR /&gt;
This command for a search works well:&lt;BR /&gt;
 rex field=user_description  "((?[^)]*)"&lt;/P&gt;

&lt;P&gt;But when a try to configure this inside a query of a dashboard it does not work i guess because some incomptability with xml&lt;/P&gt;

&lt;P&gt;The alternative is to extract field in the sourcetype but I am not able to obtain regular expression&lt;/P&gt;

&lt;P&gt;Could anyone provide the regex code&lt;/P&gt;

&lt;P&gt;Example of the data:&lt;/P&gt;

&lt;P&gt;{"userid": 1, "action": "development (project)", "user_description": " Michael Jordan (adm-Jordan)"}&lt;/P&gt;

&lt;P&gt;And I would like to obtain:    &lt;STRONG&gt;adm-Jordan&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Please take into account that other fields can contain information between parenthesis but in my case I would like to obtain data inside parenthesis when first coincidence after user_description appears&lt;/P&gt;

&lt;P&gt;Many thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 18:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496142#M84627</guid>
      <dc:creator>jaimelopez</dc:creator>
      <dc:date>2020-05-11T18:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496143#M84628</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{\"userid\": 1, \"action\": \"development (project)\", \"user_description\": \" Michael Jordan (adm-Jordan)\"}"
| spath
| rex field=user_description "\((?&amp;lt;description&amp;gt;.*)\)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;spath&lt;/CODE&gt; is useful.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 19:21:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496143#M84628</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-11T19:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496144#M84629</link>
      <description>&lt;P&gt;Hi to4kawa,&lt;/P&gt;

&lt;P&gt;This is not what i want.&lt;/P&gt;

&lt;P&gt;The spath command extracts field and value pairs on structured event data, such as XML and JSON.&lt;BR /&gt;
What I want to extract is only the data inside the parenthesis related to  &lt;CODE&gt;user_description&lt;/CODE&gt; field&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 23:34:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496144#M84629</guid>
      <dc:creator>jaimesplunk88</dc:creator>
      <dc:date>2020-05-11T23:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496145#M84630</link>
      <description>&lt;P&gt;I see, my answer is updated.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 03:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496145#M84630</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-12T03:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496146#M84631</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"userid\": 1, \"action\": \"development (project)\", \"user_description\": \" Michael Jordan (adm-Jordan)\"}" 
| spath path=user_description output=user_description 
| rex field=user_description "\((?P&amp;lt;result&amp;gt;[^)]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 03:12:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496146#M84631</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-05-12T03:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496147#M84632</link>
      <description>&lt;P&gt;Hi @vnravikumar ,&lt;BR /&gt;
The thing is that I need this search to be included in a dashboard and when I write it in the code&lt;BR /&gt;
I have this error "Unexpected close tags" and it is a problem of the line of rex&lt;/P&gt;

&lt;P&gt;The data has to be shown in a dashboard, not simple search.&lt;/P&gt;

&lt;P&gt;Yu know what could be the problem?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Jaime&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 10:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496147#M84632</guid>
      <dc:creator>jaimelopez</dc:creator>
      <dc:date>2020-05-12T10:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496148#M84633</link>
      <description>&lt;P&gt;Hi @to4kawa  ,&lt;BR /&gt;
The thing is that I need this search to be included in a dashboard and when I write it in the code&lt;BR /&gt;
I have this error "Unexpected close tags" and it is a problem of the line of rex&lt;/P&gt;

&lt;P&gt;The data has to be shown in a dashboard, not simple search.&lt;/P&gt;

&lt;P&gt;Yu know what could be the problem?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Jaime&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 10:43:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496148#M84633</guid>
      <dc:creator>jaimelopez</dc:creator>
      <dc:date>2020-05-12T10:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496149#M84634</link>
      <description>&lt;P&gt;Is it possible to post your XML?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 10:55:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496149#M84634</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-05-12T10:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496150#M84635</link>
      <description>&lt;P&gt;Hi @vnravikumar &lt;BR /&gt;
Yes, here you have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="time_picker" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;
| makeresults 
| eval _raw="{\"userid\": 1, \"action\": \"development (project)\", \"user_description\": \" Michael Jordan (adm-Jordan)\"}" 
| spath path=user_description output=user_description 
| rex field=user_description "\((?P&amp;lt;result&amp;gt;[^)]+)"
| table _time user_description result
          &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time_picker.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time_picker.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I checked it should be something regarding rex command&lt;BR /&gt;
Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 11:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496150#M84635</guid>
      <dc:creator>jaimelopez</dc:creator>
      <dc:date>2020-05-12T11:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496151#M84636</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=user_description "\((?P&amp;amp;lt;result&amp;amp;gt;[^)]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 11:36:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496151#M84636</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-05-12T11:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496152#M84637</link>
      <description>&lt;P&gt;it works @vnravikumar &lt;BR /&gt;
lots of thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 12:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496152#M84637</guid>
      <dc:creator>jaimelopez</dc:creator>
      <dc:date>2020-05-12T12:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to extract field: data inside a a parenthesis</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496153#M84638</link>
      <description>&lt;P&gt;Please accept my answer &lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 12:41:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Regex-to-extract-field-data-inside-a-a-parenthesis/m-p/496153#M84638</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-05-12T12:41:44Z</dc:date>
    </item>
  </channel>
</rss>

