<?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: Help with rex mode= query- doesn't show error but doesn't show anything at all? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642316#M222500</link>
    <description>&lt;P&gt;Ok, I am an idiot and apologize, I am building my experience in Splunk still.&amp;nbsp; I was outputting the results to a table but when I went to look at the raw data I see that the following is actually working!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=wineventlog eventtype="msad-dns-debuglog"&lt;/P&gt;&lt;P&gt;| rex mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;BR /&gt;&lt;BR /&gt;I am getting .&lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt; in the raw data which is a lot closer than I thought I was.&amp;nbsp; I am unsure why I am still getting that leading dot, but this is something.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;you are right, I want to catch this in indexing but wanted to verify my sed logic was accurate before I did that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 15:38:30 GMT</pubDate>
    <dc:creator>secphilomath1</dc:creator>
    <dc:date>2023-05-04T15:38:30Z</dc:date>
    <item>
      <title>Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641686#M222283</link>
      <description>&lt;P&gt;I am trying to eventually get to the point where I can add this to props.conf but am trying out the searches in splunk first to make sure they work.&amp;nbsp; &amp;nbsp;I was following this example but it wasn't work for me so I backed it up a bit and simplified it&lt;BR /&gt;&lt;BR /&gt;If I run this search, it works and converts all instances abc to def....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;| rex field=query &lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;mode=sed "s/abc/def/"&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;However, when I do this, it doesn't throw an error but doesn't convert anything, all abc's are still present in the fields..&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;| rex mode=sed "s/abc/def/"&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Been driving me nuts trying to figure out why.&lt;/FONT&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 13:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641686#M222283</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-04-28T13:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641689#M222285</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253046"&gt;@secphilomath1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Without seeing the original event it is hard to know for certain but I suspect that you simply need to add the global (g) field to the sed command.&amp;nbsp; Without it only the first match will be switched.&lt;BR /&gt;&lt;BR /&gt;For example...&lt;/P&gt;&lt;PRE&gt;| makeresults&lt;BR /&gt;| eval _raw="dummy event: abc query=abc"&lt;BR /&gt;| rex mode=sed "s/abc/def/"&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt; "dummy event: def query=abc"&lt;/P&gt;&lt;PRE&gt;| makeresults&lt;BR /&gt;| eval _raw="dummy event abc query=abc"&lt;BR /&gt;| rex mode=sed "s/abc/def/g"&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt; "dummy event: def query=def"&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 00:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641689#M222285</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-04-28T00:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641705#M222293</link>
      <description>&lt;P&gt;This means that the data that populates the field "query" at search time is absent from _raw events. &amp;nbsp;For example, "query" could come from an automatic lookup. &amp;nbsp;Or it could be a calculated field. &amp;nbsp;And so on.&lt;/P&gt;&lt;P&gt;This test can help you diagnose:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where match(_raw, "abc")&lt;/LI-CODE&gt;&lt;P&gt;If this returns any event, and the rex mode=sed command still doesn't take effect, you have discovered a bug.&lt;/P&gt;&lt;P&gt;Another useful test would be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=query mode=sed "s/abc/def/" ``` you indicate that this successfully changes abc in query to def ```
| where match(_raw, "abc")&lt;/LI-CODE&gt;&lt;P&gt;This is the same expectation: you should get no event because the prior sed doesn't change _raw field.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 05:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641705#M222293</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-28T05:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641791#M222318</link>
      <description>&lt;P&gt;Would this count as a calculated field, this is all I see in the props.conf currently for this particular field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FIELDALIAS-query = questionname AS query&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 18:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641791#M222318</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-04-28T18:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641803#M222325</link>
      <description>&lt;P&gt;That is a field alias, not calculated field. &amp;nbsp;Based on this information, I assume that questionname is in raw events. &amp;nbsp;Do you see any event with questionname and "abc"? &amp;nbsp;I understand the need to anonymize data. &amp;nbsp;But you need to describe your data characteristics accurately. &amp;nbsp;What is the data format? &amp;nbsp;Key-value pair? JSON? &amp;nbsp;XML? Freehand? &amp;nbsp;Given a snippet of raw event, how is Splunk supposed to know how to populate questionname?&lt;/P&gt;&lt;P&gt;Also, does the test query return any events?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 22:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641803#M222325</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-04-28T22:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641826#M222334</link>
      <description>&lt;P&gt;If you expect the rex command to substitute one string for another in raw event and thus make Splunk extract all the field values from an event modified that way - it won't work. Why should it?&lt;/P&gt;&lt;P&gt;Splunk extracts fields automatically as needed at the beginning of the pipeline. When you modify the _raw field it's just a field - yes, it's a default field for many commands but it's just a field. So you might modify _raw with rex or any other command but it won't change the extracted fields.&lt;/P&gt;&lt;P&gt;Per analogiam - if you do&lt;/P&gt;&lt;PRE&gt;index=whatever&lt;BR /&gt;| fields *&lt;BR /&gt;| eval _raw=""&lt;/PRE&gt;&lt;P&gt;You should expect to see all your original fields extracted even though at some point you've overwritten the _raw field with empty string.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Apr 2023 17:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641826#M222334</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-04-29T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641932#M222373</link>
      <description>&lt;P&gt;What I am trying to do is convert MS DNS Logs to readable text.&amp;nbsp; I understand that there is probably an app for this but want to do it manually&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input data is (3)www(6)google(3)com(0) and I want to change it to &lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I had this working fine -&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;| rex field=query mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;BR /&gt;&lt;BR /&gt;It takes all the (#) and converts it to a . and then goes through and removes the first and last .'s&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So I am trying to convert this to a sed command to do this on indexing but can't get it to work, I simplified what I was doing with examples that showed the same behavior.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 23:47:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641932#M222373</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-05-01T23:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641971#M222385</link>
      <description>&lt;P&gt;OK now this makes sense. &amp;nbsp;Your actual regex is not simply s/abc/def/, but something like s/^abc/def/. &amp;nbsp;In regex, "^" and "$" are anchors that do not correspond to actual characters. &amp;nbsp;Whereas "abc" is anchored at the beginning of the field "query", it may not - and often is not anchored at the beginning of _raw.&lt;/P&gt;&lt;P&gt;Suppose your raw event is&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%" height="25px"&gt;blah blahsomething query="(3)www(6)google(3)com(0)" morestuff&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Splunk will give you&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;_raw&lt;/TD&gt;&lt;TD width="50%"&gt;query&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;blah blahsomething query="(3)www(6)google(3)com(0)" morestuff&lt;/TD&gt;&lt;TD width="50%"&gt;(3)www(6)google(3)com(0)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;In this case,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=query mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;/LI-CODE&gt;&lt;P&gt;will give you&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;_raw&lt;/TD&gt;&lt;TD width="50%"&gt;query&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;blah blahsomething query="(3)www(6)google(3)com(0)" morestuff&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;but&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;/LI-CODE&gt;&lt;P&gt;gives&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;_raw&lt;/TD&gt;&lt;TD width="50%"&gt;query&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;blah blahsomething query=".&lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt;." morestuff&lt;/TD&gt;&lt;TD width="50%"&gt;(3)www(6)google(3)com(0)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Does this sound right?&lt;/P&gt;&lt;P&gt;In such cases, you will need to find other ways to anchor your replacements in regex. &amp;nbsp;In the above example, &amp;nbsp;"query" in the raw event is bounded by quotation marks. &amp;nbsp;So, you can use quotation marks as anchor, i.e.,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/\(.*?\)/./g s/\"\.+(\s+)?/\"/ s/\.\"/\"/"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Of course, depending on actual raw events, /\(.*?\)/ could be way too broad, and quotation marks could be used in other fields that may legitimately begin or end with a dot. &amp;nbsp;So, this might be a safer choice:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/\"\(\d+\){1,}(\s+)?/\"/ s/\(\d+\)\"/\"/ s/\(\d+\)/./g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 08:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/641971#M222385</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-02T08:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642073#M222416</link>
      <description>&lt;P&gt;When I try the two samples provided;&lt;/P&gt;&lt;PRE&gt;| rex mode=sed "s/\(.*?\)/./g s/\"\.+(\s+)?/\"/ s/\.\"/\"/"&lt;/PRE&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| rex mode=sed "s/\"\(\d+\){1,}(\s+)?/\"/ s/\(\d+\)\"/\"/ s/\(\d+\)/./g"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;They run without error but don't actually modify the output.&amp;nbsp; Similar to what I was seeing earlier.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help with this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 22:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642073#M222416</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-05-02T22:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642089#M222424</link>
      <description>&lt;P&gt;Can you share more of raw data than just&amp;nbsp;&lt;SPAN&gt;(3)www(6)google(3)com(0)?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 04:04:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642089#M222424</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-03T04:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642195#M222459</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Here are a few more examples;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(3)www(6)google(2)ca(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(7)outlook(9)office365(3)com(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(7)updates(4)asdf(3)com(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(4)test(4)test(3)com(0)&lt;/SPAN&gt;&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>Wed, 03 May 2023 21:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642195#M222459</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-05-03T21:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642197#M222460</link>
      <description>&lt;P&gt;Ok, using the original data, here is a result that works.....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval _raw="(3)www(6)google(2)ca(0)"&lt;/P&gt;&lt;P&gt;| rex mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="http://www.google.ca" target="_blank"&gt;www.google.ca&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 23:03:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642197#M222460</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-05-03T23:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642206#M222464</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253046"&gt;@secphilomath1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;SPAN&gt;Here are a few more examples;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(3)www(6)google(2)ca(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(7)outlook(9)office365(3)com(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(7)updates(4)asdf(3)com(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(4)test(4)test(3)com(0)&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is not what meant by more details of &lt;STRONG&gt;raw&lt;/STRONG&gt; events because all of these can pass the original regex. &amp;nbsp;I want to see what is surrounding the RAW events, not just query field. &amp;nbsp;In other word, it is critical to know the boundary before the first "." and the last ".". &amp;nbsp;Without knowing that, volunteers are just wasting time speculating.&lt;/P&gt;&lt;P&gt;It is impossible that an entire raw event only contains a single string "&lt;SPAN&gt;(7)updates(4)asdf(3)com(0)". (Otherwise your original regex should have succeeded.) &amp;nbsp;Is this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 00:14:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642206#M222464</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-04T00:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642250#M222478</link>
      <description>&lt;P&gt;Also, you said somewhere earlier that you want to do this "on indexing". So what's the real issue here?&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 09:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642250#M222478</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-05-04T09:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642316#M222500</link>
      <description>&lt;P&gt;Ok, I am an idiot and apologize, I am building my experience in Splunk still.&amp;nbsp; I was outputting the results to a table but when I went to look at the raw data I see that the following is actually working!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=wineventlog eventtype="msad-dns-debuglog"&lt;/P&gt;&lt;P&gt;| rex mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;BR /&gt;&lt;BR /&gt;I am getting .&lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt; in the raw data which is a lot closer than I thought I was.&amp;nbsp; I am unsure why I am still getting that leading dot, but this is something.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;you are right, I want to catch this in indexing but wanted to verify my sed logic was accurate before I did that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 15:38:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642316#M222500</guid>
      <dc:creator>secphilomath1</dc:creator>
      <dc:date>2023-05-04T15:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex mode= query- doesn't show error but doesn't show anything at all?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642365#M222516</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;index=wineventlog eventtype="msad-dns-debuglog"&lt;P&gt;| rex mode=sed "s/\(.*?\)/./g s/^\.+(\s+)?// s/\.$//"&lt;BR /&gt;&lt;BR /&gt;I am getting .&lt;A href="http://www.google.com" target="_blank" rel="noopener"&gt;www.google.com&lt;/A&gt; in the raw data which is a lot closer than I thought I was.&amp;nbsp; I am unsure&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You are still not illustrating what is in the raw event. &amp;nbsp;This result only suggests that&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;the targeted string (e.g., "&lt;SPAN&gt;(3)www(6)google(3)com(0)") is at the end of the line in the raw event (thus positive on s/\.$//);&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;there is some other string before the target string in the raw event (thus negative for s/^\.+(\s+)?//); and&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;the character immediately before the target string is &lt;STRONG&gt;not&lt;/STRONG&gt; a quotation mark as I used to illustrate my point about anchor in regex.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;If there is some guarantee that 1 is always true in eventtype mdad-dns-debuglog, it would be fine to anchor your regex against $. &amp;nbsp;But you have to show us what that leading anchor can possibly be. &amp;nbsp;By the way, using elimination of \. AFTER substitution, whether leading or trailing, is a very risky strategy because you could easily be altering parts of the raw string you don't want to alter. &amp;nbsp;It is much safer to be explicit about those "(3)", etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want to be as generic as possible but minimize the risk of undesirable alterations, this is perhaps the best approach:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/(\W+)\(\d+\)/\1/ s/\(\d+\)$// s/\(\d+\)(\W)/\1/ s/(\w)\(\d+\)(\w)/\1.\2/g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 08:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex-mode-query-doesn-t-show-error-but-doesn-t-show/m-p/642365#M222516</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-05-05T08:23:59Z</dc:date>
    </item>
  </channel>
</rss>

