<?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 rex value from SQL and charting? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601642#M209384</link>
    <description>&lt;P&gt;I am not sure I understand - do you want the /* .... */ included in SQLstmt? Also, what doesn't work about the other statement?&lt;/P&gt;&lt;P&gt;Please clarify your &lt;STRONG&gt;complete&lt;/STRONG&gt; requirement.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2022 05:19:54 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-06-14T05:19:54Z</dc:date>
    <item>
      <title>How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601407#M209309</link>
      <description>&lt;P&gt;From this given log:&lt;/P&gt;
&lt;P&gt;"SQL:&lt;FONT color="#FF6600"&gt;SELECT TABLE_NAME, COLUMN_NAME&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008000"&gt;FROM TABLE_COLUMNS&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;WHERE SCHEMA_NAME = ? AND TABLE_NAME in (?,?,?,?,?,?,?) AND DATA_TYPE_NAME IN ('CLOB', 'NCLOB', 'BLOB')&lt;/FONT&gt;","i":1,&lt;FONT color="#008000"&gt;"t":250&lt;/FONT&gt;,"&lt;FONT color="#008000"&gt;slft":250&lt;/FONT&gt;,"st":250,"m":16,"nr":0,"rt":0,"rn":8,"fs":0}&lt;/P&gt;
&lt;P&gt;1. I want to extract the&amp;nbsp;&lt;FONT color="#FF6600"&gt;entire SQL's&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;containing table names "&lt;FONT color="#FF6600"&gt;&lt;FONT color="#008000"&gt;TABLE_COLUMNS"&amp;nbsp; &amp;nbsp;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2. Extract their corresponding&amp;nbsp; numbers for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;t , slft&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;3. chart on:&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;SQL_STMT&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;|&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008000"&gt;t | slft&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I need some help to get this query&amp;nbsp;working:&amp;nbsp;&lt;/FONT&gt;&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;"SELECT TABLE_NAME, COLUMN_NAME FROM TABLE_COLUMNS WHERE SCHEMA_NAME"
| rex field= _raw "\"SQL:(?P&amp;lt;SQL_stmt&amp;gt;)\s*[FROM TABLE_COLUMNS]\s+\""
| rex field=_raw "SELECT \s*  FROM TABLE_COLUMNS \s* ,\"t\":(?P&amp;lt;tvalue&amp;gt;[\d]) "slft":?P&amp;lt;slft_value&amp;gt;\d"| chart count over by SQL_stmt,tvalue, slft_value | sort  by slft_value desc&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 19:01:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601407#M209309</guid>
      <dc:creator>cdowlathram</dc:creator>
      <dc:date>2022-06-10T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Rex value from SQL and charting</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601409#M209311</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your base search fetching SQL logs
| rex "SQL\:.+\sFROM\s(?&amp;lt;SQL_stmt&amp;gt;\S+)"
| rex "\"t\"\:(?&amp;lt;tValue&amp;gt;\d+)"
| rex "\"slft\"\:(?&amp;lt;slftValue&amp;gt;\d+)"
| stats count by SQL_stmt tValue slftValue
| sort slft_value desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 18:40:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601409#M209311</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-06-10T18:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601417#M209312</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp; - Thanks for your input !&amp;nbsp; Two things:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I see the SQL_stmt does not capture the entire SQL statement , instead it captures "tableName" . So I set it to capture the table name. I'm still unable to capture the SQL_stmt.&amp;nbsp; I set the right boundary of the&amp;nbsp; SQL_stmt with a \", but still no luck.&amp;nbsp; &amp;nbsp;Could you please help me with this .&lt;/P&gt;&lt;P&gt;2. The tValue and slftValue does not capture the values corresponding to&amp;nbsp; the pattern :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;SQL:SELECT TABLE_NAME, COLUMN_NAME FROM TABLE_COLUMNS WHERE SCHEMA_NAME = ? AND TABLE_NAME in (?,?,?,?,?,?,?) AND DATA_TYPE_NAME IN ('CLOB', 'NCLOB','BLOB')","i":1,"t":250,"slft":250,"st":250,"m":16,"nr":0,"rt":0,"rn":8,"fs":0} &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Instead it has a value from a different table and not&amp;nbsp;&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;TABLE_COLUMN&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;I tried this , no luck :&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"SELECT TABLE_NAME, COLUMN_NAME FROM TABLE_COLUMNS WHERE SCHEMA_NAME"
| rex "SQL\:SELECT TABLE_NAME, COLUMN_NAME FROM TABLE_COLUMNS \s* \"t\"\:(?&amp;lt;tValue&amp;gt;\d+)"
| stats count by SQL_stmt tValue 
| sort by slft_value desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 23:16:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601417#M209312</guid>
      <dc:creator>cdowlathram</dc:creator>
      <dc:date>2022-06-10T23:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601424#M209313</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"SQL:(?&amp;lt;SQL_stmt&amp;gt;[^\"]+)\""
| rex "\"t\":(?&amp;lt;t&amp;gt;[\d]+)\.*\"slft\"\:(?&amp;lt;slft&amp;gt;\d+),"&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 Jun 2022 08:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601424#M209313</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-11T08:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601608#M209372</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; - Thanks for your response .&amp;nbsp; The SQL stmt gets populated now , however the following SQL stmt and its corresponding&amp;nbsp; slft value does not gets captured.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN class=""&gt;SQL:SELECT&lt;/SPAN&gt; &lt;SPAN class=""&gt;TABLE_NAME&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;COLUMN_NAME&lt;/SPAN&gt; &lt;SPAN class=""&gt;FROM&lt;/SPAN&gt; &lt;SPAN class=""&gt;TABLE_COLUMNS&lt;/SPAN&gt; &lt;SPAN class=""&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class=""&gt;SCHEMA_NAME&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; ? &lt;/SPAN&gt;&lt;SPAN class=""&gt;AND&lt;/SPAN&gt; &lt;SPAN class=""&gt;TABLE_NAME&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; (?,?,?,?,?,?,?) &lt;/SPAN&gt;&lt;SPAN class=""&gt;AND&lt;/SPAN&gt; &lt;SPAN class=""&gt;DATA_TYPE_NAME&lt;/SPAN&gt; &lt;SPAN class=""&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;#2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;* &lt;/SPAN&gt;&lt;SPAN class=""&gt;BAD_SQL_WITH_LITERAL&lt;/SPAN&gt;&lt;SPAN&gt; *&lt;/SPAN&gt;&lt;SPAN class=""&gt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;","&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;&lt;SPAN class=""&gt;i&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:1&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:410&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;slft&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:410&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;st&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:410&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;m&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:54&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;nr&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:0&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;rt&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:0&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;rn&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:8&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;fs&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:0&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I include this boundary condition ? :&amp;nbsp;&lt;FONT color="#FF6600"&gt;&lt;SPAN class=""&gt;/&lt;/SPAN&gt;* &lt;SPAN class=""&gt;BAD_SQL_WITH_LITERAL&lt;/SPAN&gt; *&lt;SPAN class=""&gt;/&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried this :&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;rex "\"SQL:(?&amp;lt;SQL_stmt&amp;gt;[\/\* BAD_SQL_WITH_LITERAL \*\//^\"]+)\""&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but no luck yet. What am I missing here ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 18:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601608#M209372</guid>
      <dc:creator>cdowlathram</dc:creator>
      <dc:date>2022-06-13T18:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601620#M209377</link>
      <description>&lt;P&gt;Does this work for you?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"SQL:(?&amp;lt;SQL_stmt&amp;gt;[^\"\/]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 13 Jun 2022 22:21:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601620#M209377</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-13T22:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601623#M209380</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;- Yes it does, but not for this event :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN class=""&gt;SQL:SELECT&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;TABLE_NAME&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;COLUMN_NAME&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;TABLE_COLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;WHERE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SCHEMA_NAME&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;AND&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;TABLE_NAME&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(?,?,?,?,?,?,?)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;AND&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;DATA_TYPE_NAME&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;#2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;*&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;BAD_SQL_WITH_LITERAL&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;*&lt;/SPAN&gt;&lt;SPAN class=""&gt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;","&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;&lt;SPAN class=""&gt;i&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:1&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:410&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;slft&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:410&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;st&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:410&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;m&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:54&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;nr&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:0&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;rt&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:0&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;rn&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:8&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;fs&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:0&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The querry does not work for the following event as well :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808000"&gt;&lt;SPAN&gt;{"&lt;/SPAN&gt;&lt;SPAN class=""&gt;n&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;SQL:&lt;/SPAN&gt; &lt;SPAN class=""&gt;select&lt;/SPAN&gt; &lt;SPAN class=""&gt;column_name&lt;/SPAN&gt; &lt;SPAN class=""&gt;from&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;table_columns&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;where&lt;/SPAN&gt; &lt;SPAN class=""&gt;table_name&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; ? &lt;/SPAN&gt;&lt;SPAN class=""&gt;and&lt;/SPAN&gt; &lt;SPAN class=""&gt;schema_name&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;pkg_tool_get_user&lt;/SPAN&gt;&lt;SPAN&gt;() ; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Params:&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;1:A_NT_EVTHT&lt;/SPAN&gt;&lt;SPAN&gt;, ); &lt;/SPAN&gt;&lt;SPAN class=""&gt;Method&lt;/SPAN&gt; &lt;SPAN class=""&gt;name:execute&lt;/SPAN&gt;&lt;SPAN&gt;","&lt;/SPAN&gt;&lt;SPAN class=""&gt;i&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:1&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class=""&gt;t&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;SPAN class=""&gt;279&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had modified the query like so :&amp;nbsp;&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;"SELECT TABLE_NAME, COLUMN_NAME FROM TABLE_COLUMNS WHERE SCHEMA_NAME"
| rex   "\"SQL:(?&amp;lt;SQL_src&amp;gt;[^}]+)}"
| rex  field=SQL_src "(?&amp;lt;SQLstmt&amp;gt;[^\"]+)\""
| rex field=SQL_src ".+\sFROM\s(?&amp;lt;tableName&amp;gt;\S+)"
| rex field=SQL_src "\"t\"\:(?&amp;lt;tValue&amp;gt;\d+)"
| rex field=SQL_src "\"i\"\:(?&amp;lt;iValue&amp;gt;\d+)"
| search tableName=*
| stats count(iValue) as iValue by SQLstmt,tableName,SQLT,tValue
| sort by tValue desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp; field ```SQL_src``` does not capture the above mentioned event . Looks like I need to include&amp;nbsp; validation for boundary&amp;nbsp;&lt;FONT color="#FF6600"&gt;&lt;SPAN class=""&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;*&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;BAD_SQL_WITH_LITERAL&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;*&lt;/SPAN&gt;&lt;SPAN class=""&gt;/".&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class=""&gt;But it works fine for the other cases.&amp;nbsp; How do I escape the&amp;nbsp;&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;/"&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;?&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;FONT color="#FF6600"&gt;.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 23:58:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601623#M209380</guid>
      <dc:creator>cdowlathram</dc:creator>
      <dc:date>2022-06-13T23:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601626#M209381</link>
      <description>&lt;P&gt;Finally this worked :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"TABLE_COLUMNS"
| rex "\"SQL:(?&amp;lt;SQL_src&amp;gt;[^}]+)}"
| rex field=SQL_src "(?&amp;lt;SQLstmt&amp;gt;[^\"]+)\""
| rex field=SQL_src ".+\sfrom\s(?&amp;lt;tableName&amp;gt;\S+)"
| rex field=SQL_src "\"t\"\:(?&amp;lt;tValue&amp;gt;\d+)"
| rex field=SQL_src "\"i\"\:(?&amp;lt;iValue&amp;gt;\d+)"
| where match(tableName,"(?i)table*")
| stats count(iValue) as iValue by SQLstmt,tableName,SQLT,tValue
| sort by tValue desc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp; !&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 00:48:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601626#M209381</guid>
      <dc:creator>cdowlathram</dc:creator>
      <dc:date>2022-06-14T00:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract rex value from SQL and charting?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601642#M209384</link>
      <description>&lt;P&gt;I am not sure I understand - do you want the /* .... */ included in SQLstmt? Also, what doesn't work about the other statement?&lt;/P&gt;&lt;P&gt;Please clarify your &lt;STRONG&gt;complete&lt;/STRONG&gt; requirement.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 05:19:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-rex-value-from-SQL-and-charting/m-p/601642#M209384</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-14T05:19:54Z</dc:date>
    </item>
  </channel>
</rss>

