<?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: Does Rex  in splunk  support variable  in  regular expression ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608783#M211684</link>
    <description>&lt;P&gt;Example, My raw &amp;nbsp;text could be&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ue-CapabilityEnquiryExt": {"capabilityRequestFilterCommon": {"&lt;SPAN&gt;uplinkTxSwitchRequest-r16&lt;/SPAN&gt;": "&lt;SPAN&gt;true&lt;/SPAN&gt;"}, &amp;nbsp; how can I embedded $kw$ in Rex expression ,&amp;nbsp;$kw$ &amp;nbsp;is the text value input by user to search a certain key. &amp;nbsp;it could be "&lt;SPAN&gt;uplinkTxSwitchRequest-r16&lt;/SPAN&gt;" or some other key words .&lt;/P&gt;&lt;P&gt;I ever tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;rex field=_raw "\"$kw$\": \"(?&amp;lt;&lt;SPAN&gt;KeyValue&lt;/SPAN&gt;&amp;gt;.*)\"", but didn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 06:47:26 GMT</pubDate>
    <dc:creator>Tao_Zeng</dc:creator>
    <dc:date>2022-08-09T06:47:26Z</dc:date>
    <item>
      <title>Does Rex  in splunk  support variable  in  regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608782#M211683</link>
      <description>&lt;P&gt;Does Rex in splunk support variable in regular expression ? For example, &amp;nbsp; user could input a text from UI, usually I need &amp;nbsp;a variable like $kw$ &amp;nbsp;to get the input from user, &amp;nbsp;and &amp;nbsp;use&amp;nbsp;$kw$ &amp;nbsp;in rex command &amp;nbsp;, Can splunk support this way ? and how ? &amp;nbsp;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 15:00:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608782#M211683</guid>
      <dc:creator>Tao_Zeng</dc:creator>
      <dc:date>2022-08-09T15:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Does Rex  in splunk  support variable  in  regular expression ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608783#M211684</link>
      <description>&lt;P&gt;Example, My raw &amp;nbsp;text could be&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ue-CapabilityEnquiryExt": {"capabilityRequestFilterCommon": {"&lt;SPAN&gt;uplinkTxSwitchRequest-r16&lt;/SPAN&gt;": "&lt;SPAN&gt;true&lt;/SPAN&gt;"}, &amp;nbsp; how can I embedded $kw$ in Rex expression ,&amp;nbsp;$kw$ &amp;nbsp;is the text value input by user to search a certain key. &amp;nbsp;it could be "&lt;SPAN&gt;uplinkTxSwitchRequest-r16&lt;/SPAN&gt;" or some other key words .&lt;/P&gt;&lt;P&gt;I ever tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;rex field=_raw "\"$kw$\": \"(?&amp;lt;&lt;SPAN&gt;KeyValue&lt;/SPAN&gt;&amp;gt;.*)\"", but didn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 06:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608783#M211684</guid>
      <dc:creator>Tao_Zeng</dc:creator>
      <dc:date>2022-08-09T06:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Does Rex  in splunk  support variable  in  regular expression ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608788#M211688</link>
      <description>&lt;P&gt;In what way did this not work?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rex field=_raw "\"$kw$\": \"(?&amp;lt;KeyValue&amp;gt;.*)\""&lt;/LI-CODE&gt;&lt;P&gt;Although, to be fair, this does rely on the user using a regex compatible match value, so you could try this (to make it easier for the user&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rex field=_raw "\"$kw$[^\"]*\": \"(?&amp;lt;KeyValue&amp;gt;.*)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Aug 2022 07:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608788#M211688</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-09T07:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Does Rex  in splunk  support variable  in  regular expression ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608818#M211701</link>
      <description>&lt;P&gt;I tried again，&amp;nbsp;rex field=_raw "\"$kw$\": \"(?&amp;lt;KeyValue&amp;gt;.*)\"" &amp;nbsp; --- This acturally works.&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;rex field=_raw "\"$kw$[^\"]*\": \"(?&amp;lt;KeyValue&amp;gt;.*)\""&lt;/PRE&gt;&lt;P&gt;is good reminding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;nbsp;&lt;SPAN&gt;ITWhisperer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One &amp;nbsp;more&amp;nbsp;question is , $ &amp;nbsp;is a&amp;nbsp;special &amp;nbsp;symbol &amp;nbsp;on&amp;nbsp;regular expression , how does Splunk identify it as a&amp;nbsp;prefix &amp;nbsp;of a&amp;nbsp;variable &amp;nbsp;or &amp;nbsp;a&amp;nbsp;regular expression symbol ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 08:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608818#M211701</guid>
      <dc:creator>Tao_Zeng</dc:creator>
      <dc:date>2022-08-09T08:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Does Rex  in splunk  support variable  in  regular expression ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608820#M211702</link>
      <description>&lt;P&gt;Yes, $ is a special symbol in rex, however, in this instance, you are specifying a token in a dashboard, and this is substituted into the search string before it is passed to the rex command.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 08:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608820#M211702</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-09T08:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Does Rex  in splunk  support variable  in  regular expression ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608939#M211751</link>
      <description>&lt;P&gt;This make sense， thanks for detailed explanation .&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 02:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-Rex-in-splunk-support-variable-in-regular-expression/m-p/608939#M211751</guid>
      <dc:creator>Tao_Zeng</dc:creator>
      <dc:date>2022-08-10T02:04:44Z</dc:date>
    </item>
  </channel>
</rss>

