<?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 Fetch exact value using REX command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/524829#M148057</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can someone please help me here: To fetch&lt;/P&gt;&lt;P&gt;value = private and operation= OVERRIDE using rex command?&lt;/P&gt;&lt;P&gt;I tried to fetch using below command:&amp;nbsp;&lt;/P&gt;&lt;P&gt;|rex max_match=0 field=_raw "IP BLOCK TYPE\",value=\"(?&amp;lt;IP_Block_Type&amp;gt;.*?)\s*(\w*+)\]"| eval IP_Block_Type= substr(IP_Block_Type, 1, len(IP_Block_Type)-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;|rex max_match=0 field=_raw "IP BLOCK TYPE\",operation=\"(?&amp;lt;IP_Block_Type&amp;gt;.*?)\s*(\w*+)\]"| eval IP_Block_Type= substr(IP_Block_Type, 1, len(IP_Block_Type)-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[name="IP BLOCK TYPE",value="Private",operation="OVERRIDE"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 11:07:09 GMT</pubDate>
    <dc:creator>sgulhane5</dc:creator>
    <dc:date>2020-10-15T11:07:09Z</dc:date>
    <item>
      <title>Fetch exact value using REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/524829#M148057</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can someone please help me here: To fetch&lt;/P&gt;&lt;P&gt;value = private and operation= OVERRIDE using rex command?&lt;/P&gt;&lt;P&gt;I tried to fetch using below command:&amp;nbsp;&lt;/P&gt;&lt;P&gt;|rex max_match=0 field=_raw "IP BLOCK TYPE\",value=\"(?&amp;lt;IP_Block_Type&amp;gt;.*?)\s*(\w*+)\]"| eval IP_Block_Type= substr(IP_Block_Type, 1, len(IP_Block_Type)-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;|rex max_match=0 field=_raw "IP BLOCK TYPE\",operation=\"(?&amp;lt;IP_Block_Type&amp;gt;.*?)\s*(\w*+)\]"| eval IP_Block_Type= substr(IP_Block_Type, 1, len(IP_Block_Type)-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[name="IP BLOCK TYPE",value="Private",operation="OVERRIDE"]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 11:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/524829#M148057</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-15T11:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch exact value using REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/524830#M148058</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226890"&gt;@sgulhane5&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if the logs you have is something like what you shared&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[name="IP BLOCK TYPE",value="Private",operation="OVERRIDE"]&lt;/LI-CODE&gt;&lt;P&gt;you don't need a dedicated regex extraction because Splunk automatically recognizes pairs field=value.&lt;/P&gt;&lt;P&gt;Anyway, you can extract "Private" and "OVERRIDE" using this regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "value\=\"(?&amp;lt;value&amp;gt;[^\"]*)\",operation\=\"(?&amp;lt;operation&amp;gt;[^\"]*)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/Y2VMtX/1" target="_blank"&gt;https://regex101.com/r/Y2VMtX/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 11:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/524830#M148058</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-10-15T11:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch exact value using REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525086#M148136</link>
      <description>&lt;P&gt;not working&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 15:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525086#M148136</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-16T15:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch exact value using REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525088#M148138</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;the log message is looks like&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class="t"&gt;name=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;IP&lt;/SPAN&gt; &lt;SPAN class="t"&gt;BLOCK&lt;/SPAN&gt; &lt;SPAN class="t"&gt;TYPE&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;value=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;Private&lt;/SPAN&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;SPAN class="t"&gt;operation=&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;OVERRIDE&lt;/SPAN&gt;&lt;SPAN&gt;"]. I just wanted to fetch operation="OVERRIDE" through the regex.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525088#M148138</guid>
      <dc:creator>sgulhane5</dc:creator>
      <dc:date>2020-10-16T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch exact value using REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525115#M148148</link>
      <description>&lt;P&gt;What issues are you facing using&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;'s answer?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 19:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525115#M148148</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-10-16T19:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch exact value using REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525182#M148169</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/226890"&gt;@sgulhane5&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you want to extract the value "OVERRIDE" and put it in the field "operation", my regex is correct, if instead you want all the string "operation=OVERRIDE", it's different.&lt;/P&gt;&lt;P&gt;Please confirm that you have the message:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[name="IP BLOCK TYPE",value="Private",operation="OVERRIDE"]&lt;/LI-CODE&gt;&lt;P&gt;and that you want to extract the value "Private" and put it into the field "value" and the value "OVERRIDE" and put it into the field "operation".&lt;/P&gt;&lt;P&gt;Only one additional question: message is a field of your full row log?&lt;/P&gt;&lt;P&gt;If it's the full row log, my regex is correct, if instead message is a field, you have to modify my rex command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=message "value\=\"(?&amp;lt;value&amp;gt;[^\"]*)\",operation\=\"(?&amp;lt;operation&amp;gt;[^\"]*)"&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2020 10:04:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Fetch-exact-value-using-REX-command/m-p/525182#M148169</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-10-17T10:04:56Z</dc:date>
    </item>
  </channel>
</rss>

