<?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: Using | rex with $ in Dashboards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640576#M221950</link>
    <description>&lt;P&gt;thanks for your guesses. still looking for a documentation.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2023 12:03:26 GMT</pubDate>
    <dc:creator>bitnapper</dc:creator>
    <dc:date>2023-04-19T12:03:26Z</dc:date>
    <item>
      <title>How to reliably use a | rex command in a dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640357#M221898</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I regularly have the problem, that I save searches containing regexes with $ characters to a dashboard where they are then not showing any result. I guess I have to escape them somehow. It seems while saving them the $ characters are automatically duplicated but it that is supposed to be some kind of escaping its not working.&lt;/P&gt;
&lt;P&gt;I could not find anything in the documentation but since there are plenty I was not shure where to look exactly. Can anyone tell me how to reliably use a | rex command in a dashboard?&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;| rex field=_raw "\s(?&amp;lt;hash&amp;gt;\S+)$"&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 21:17:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640357#M221898</guid>
      <dc:creator>bitnapper</dc:creator>
      <dc:date>2023-04-19T21:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640360#M221900</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245847"&gt;@bitnapper&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;$ in a regex means that you are at the end of the raw.&lt;/P&gt;&lt;P&gt;I found some problem escaping the \ (backslash) that's the escape char so sometimes instead using two backslashed I had to use threee of them, but I never found problems on $.&lt;/P&gt;&lt;P&gt;About use in a dashboard, insert your rehex in the search, test te search and save it in the dashboard.&lt;/P&gt;&lt;P&gt;If you directly insert a regex in a dashboard, remember to replace:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;lt; with &amp;amp;lt;&lt;/LI&gt;&lt;LI&gt;&amp;gt; with &amp;amp;gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 14:33:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640360#M221900</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-18T14:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640371#M221902</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have never had issues with &amp;lt;&amp;gt; or / but regularly with $. Testing it in the search does not help since the issue is exactly that it works in the search but not in the dashboard. But thanks for explaning to me what $ does, I would not have guessed that and just thrown it into the mix because it looks good &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So is there a documentation about how Splunk Dashboards deal with searches and what escaping is necessary or not?&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;btn&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 15:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640371#M221902</guid>
      <dc:creator>bitnapper</dc:creator>
      <dc:date>2023-04-18T15:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640373#M221903</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245847"&gt;@bitnapper&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I usually test my regexes in regex101.com (that also explays the regexes!) and then I check them in Splunk.&lt;/P&gt;&lt;P&gt;In this way the only differences I experienced are backslashes.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 15:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640373#M221903</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-18T15:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640390#M221912</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;thank you for trying but your answer has nothing todo with my question. I'm not asking about regex per se , I want to know which escaping is neccessary in dashboards.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 17:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640390#M221912</guid>
      <dc:creator>bitnapper</dc:creator>
      <dc:date>2023-04-18T17:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640525#M221936</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245847"&gt;@bitnapper&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;in my experience the only differences in escaping in searching and dashboards is backslash, also because if you escape $ you don't ute the notation of enf or row.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 07:35:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640525#M221936</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-19T07:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640576#M221950</link>
      <description>&lt;P&gt;thanks for your guesses. still looking for a documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 12:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640576#M221950</guid>
      <dc:creator>bitnapper</dc:creator>
      <dc:date>2023-04-19T12:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640578#M221951</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245847"&gt;@bitnapper&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if one answer solves your need, please accept one answer for the other people of Community or tell me how I can help you.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 12:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640578#M221951</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-04-19T12:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640665#M221969</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245847"&gt;@bitnapper&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Assuming you're creating XML dashboards, you could also try using CDATA. Edit the dashboard (go to the raw view), go to the search that you want to edit and wrap it in CDATA. An example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search&amp;gt;
&amp;lt;query&amp;gt;
&amp;lt;![CDATA[
``` 
Your search here. Because of cdata there's no need to escape text.
```
]]&amp;gt;
&amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can read more about cdata at MDN or wikipedia:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/CDATASection" target="_blank" rel="noopener"&gt;https://developer.mozilla.org/en-US/docs/Web/API/CDATASection&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/CDATA" target="_blank"&gt;https://en.wikipedia.org/wiki/CDATA&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 17:30:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640665#M221969</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-19T17:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640687#M221979</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/255848"&gt;@rut&lt;/a&gt; , thats acually helps.&lt;BR /&gt;&lt;BR /&gt;I still don't understand why that happens. I write a search and from the search page I save to a new or existing dashboard. Shouldn't that be applied automatically?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 19:50:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640687#M221979</guid>
      <dc:creator>bitnapper</dc:creator>
      <dc:date>2023-04-19T19:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640690#M221980</link>
      <description>&lt;P&gt;That’s a good question. When you save a search in the dashboard UI it gets stored encoded, e.g. Splunk translates &amp;gt; into &amp;amp;gt; so the search doesn’t break the underlying XML. You can see this happening when you inspect the XML after editing a search.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This should work fine in most cases, but maybe something is happening with token replacements? Those also use $. What happens if you execute the search with the magnifying glass in the bottom of the panel, is the pattern still the same?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 20:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640690#M221980</guid>
      <dc:creator>rut</dc:creator>
      <dc:date>2023-04-19T20:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using | rex with $ in Dashboards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640694#M221982</link>
      <description>&lt;P&gt;I don't have problems with tokens but I have encountered these problems with searches containing rex-commands with $ charachters. And those indeed get duplicated. So if I have something like &lt;FONT face="courier new,courier"&gt;| rex field=_raw "\s(?&amp;lt;x&amp;gt;\S+)$"&lt;/FONT&gt; after storing and then opening it again it has been converted to &lt;FONT face="courier new,courier"&gt;| rex field=_raw "\s(?&amp;lt;x&amp;gt;\S+)$$"&lt;/FONT&gt;. Thats why I was asking for escaping $ characters but I'll test the CDATA tomorrow. It sounds very promising.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 20:28:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reliably-use-a-rex-command-in-a-dashboard/m-p/640694#M221982</guid>
      <dc:creator>bitnapper</dc:creator>
      <dc:date>2023-04-19T20:28:36Z</dc:date>
    </item>
  </channel>
</rss>

