<?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: Rex field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640311#M221876</link>
    <description>&lt;LI-CODE lang="markup"&gt;| rex max_match=0 "\/\*(?&amp;lt;value&amp;gt;.+?)(?&amp;gt;\*\/)"&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 18 Apr 2023 06:10:30 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-04-18T06:10:30Z</dc:date>
    <item>
      <title>How to extract this string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640308#M221873</link>
      <description>&lt;P&gt;There are two types of raw data. What is the regular expression to get the value between the /* special symbol and the */ special symbol in the raw data?&lt;/P&gt;
&lt;P&gt;I tried this regex but it doesn't work&lt;/P&gt;
&lt;P&gt;rex field=query "^[^/\n]*/\*(?P&amp;lt;test&amp;gt;[^\*]+)"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA1&lt;/P&gt;
&lt;P&gt;SELECT /*4/18 test */ DRTA_SEQ\r\n FROM DATA_REQ_LIST\r\n WHERE DATE &amp;lt; TO_DATE('2023-04-18 06:00:00', 'YYYY-MM-DD HH24:MI:SS')\r\n&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA2&lt;/P&gt;
&lt;P&gt;with my_index as (\n select index_name from ALL_indexes where table_owner = :1 \n /* test select index_name from CHAN_indexes where table_owner = :schema_name and table_name in ( :[*object_names] )\n *//* test select * from Chanlist */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want this string to be extracted&lt;/P&gt;
&lt;P&gt;DATA1&lt;/P&gt;
&lt;P&gt;4/18 test&lt;/P&gt;
&lt;P&gt;DATA2&lt;/P&gt;
&lt;P&gt;test select index_name from CHAN_indexes where table_owner = :schema_name and table_name in ( :[*object_names] )\n&lt;/P&gt;
&lt;P&gt;test select * from Chanlist&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 08:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640308#M221873</guid>
      <dc:creator>chanhee1</dc:creator>
      <dc:date>2023-04-18T08:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640310#M221875</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/255942"&gt;@chanhee1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;Updating the answer with&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;regex.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval query="SELECT /*4/18 test */ DRTA_SEQ\r\n FROM DATA_REQ_LIST\r\n WHERE DATE &amp;lt; TO_DATE('2023-04-18 06:00:00', 'YYYY-MM-DD HH24:MI:SS')\r\n" 
| append 
    [| makeresults 
    | eval query="
with my_index as (\n select index_name from ALL_indexes where table_owner = :1 \n /* test select index_name from CHAN_indexes where table_owner = :schema_name and table_name in ( :[*object_names] )\n *//* test select * from Chanlist */"] 
| rex max_match=0 field=query "\/\*\s?(?&amp;lt;test&amp;gt;.+)(?&amp;gt;\*\/)"
| mvexpand test&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 06:23:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640310#M221875</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2023-04-18T06:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640311#M221876</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex max_match=0 "\/\*(?&amp;lt;value&amp;gt;.+?)(?&amp;gt;\*\/)"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Apr 2023 06:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640311#M221876</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-04-18T06:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rex field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640314#M221878</link>
      <description>&lt;P&gt;Assume that your data field is named data,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=data "^[^/]*(?&amp;lt;data_a&amp;gt;.+/)[^/]*$"
| eval data_a = split(data_a, " */")
| eval data_a = mvmap(data_a, replace(data_a, "/\* *", ""))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Apr 2023 06:26:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-this-string/m-p/640314#M221878</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-18T06:26:19Z</dc:date>
    </item>
  </channel>
</rss>

