<?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 extract a field in using regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644534#M223221</link>
    <description>&lt;P&gt;What should I modify exactly?&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 17:16:13 GMT</pubDate>
    <dc:creator>man03359</dc:creator>
    <dc:date>2023-05-24T17:16:13Z</dc:date>
    <item>
      <title>How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644519#M223217</link>
      <description>&lt;P&gt;I am relatively new to Splunk and I am trying to&amp;nbsp;extracting fields in Splunk,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a pattern I am attempting to extract and put into a field. The pattern looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class=""&gt;AdyenPaymentResponse::ProcessResponse::Response&lt;/SPAN&gt; &lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Result&lt;/SPAN&gt; &lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Failure&lt;BR /&gt;AdyenPaymentResponse::ProcessResponse::Response -&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;Result : Success&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;I am using this expression to match the pattern:&lt;/P&gt;
&lt;PRE&gt;| rex field=_raw "AdyenPaymentResponse:.*\sResult\s:(?&amp;lt;Status&amp;gt;)"&lt;/PRE&gt;
&lt;P&gt;I have to keep "AdyenPaymentResponse" as the base search and&amp;nbsp; I would like to extract this into a field called "Status" which shows only Failure or Success&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 16:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644519#M223217</guid>
      <dc:creator>man03359</dc:creator>
      <dc:date>2023-05-24T16:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644530#M223218</link>
      <description>&lt;P&gt;What is the question as this looks like it should work (although, depending on your data, you might want to use these slight modifications)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "AdyenPaymentResponse:.+\sResult\s:\s(?&amp;lt;Status&amp;gt;)"&lt;/LI-CODE&gt;&lt;P&gt;Strictly speaking, you don't need field=_raw as this is the default field for rex&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:07:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644530#M223218</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-24T17:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644531#M223219</link>
      <description>&lt;P&gt;It is not creating a field, the regex I am using&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644531#M223219</guid>
      <dc:creator>man03359</dc:creator>
      <dc:date>2023-05-24T17:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644533#M223220</link>
      <description>&lt;P&gt;You are right, I missed it too. You need to specify the pattern you want to be in the field&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "AdyenPaymentResponse:.+\sResult\s:\s(?&amp;lt;Status&amp;gt;.+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 May 2023 17:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644533#M223220</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-24T17:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644534#M223221</link>
      <description>&lt;P&gt;What should I modify exactly?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:16:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644534#M223221</guid>
      <dc:creator>man03359</dc:creator>
      <dc:date>2023-05-24T17:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644536#M223222</link>
      <description>&lt;P&gt;Add the ".+" inside the brackets after &amp;lt;status&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:19:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644536#M223222</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-05-24T17:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field in using regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644539#M223224</link>
      <description>&lt;P&gt;Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:24:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-in-using-regex/m-p/644539#M223224</guid>
      <dc:creator>man03359</dc:creator>
      <dc:date>2023-05-24T17:24:06Z</dc:date>
    </item>
  </channel>
</rss>

