<?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 do you remove special characters from a token? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453611#M128356</link>
    <description>&lt;P&gt;What about this: &lt;CODE&gt;YOUR_SEARCH | eval mac_full = "$token$" | eval mac_short = mac_full | rex field=mac_short  mode=sed "s/://g""&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Feb 2019 19:01:32 GMT</pubDate>
    <dc:creator>chrisyounger</dc:creator>
    <dc:date>2019-02-06T19:01:32Z</dc:date>
    <item>
      <title>How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453607#M128352</link>
      <description>&lt;P&gt;What would be the easiest one line solution to remove special characters from a token?&lt;/P&gt;

&lt;P&gt;I'm taking a text input (mac addresses like 00:1B:44:11:3A:B7) from the user, &amp;amp; 1 source type uses the exact address &amp;amp; another source type has no ":" in the address. &lt;/P&gt;

&lt;P&gt;I'm using the token as the complete search item (does the search content have a imbedded variable?).&lt;/P&gt;

&lt;P&gt;When I do things like add a token to an eval command, it doesn't work. It seems like there should be an easier way to get around this problem. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 14:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453607#M128352</guid>
      <dc:creator>clintla</dc:creator>
      <dc:date>2019-02-05T14:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453608#M128353</link>
      <description>&lt;P&gt;Your question would benefit from an added example to make it clearer.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 15:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453608#M128353</guid>
      <dc:creator>ccl0utier</dc:creator>
      <dc:date>2019-02-05T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453609#M128354</link>
      <description>&lt;P&gt;HI @clintla &lt;/P&gt;

&lt;P&gt;When using tokens on dashboards, you should use the token escape sequence &lt;CODE&gt;$my_token|s$&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;|s&lt;/CODE&gt; is the extra part that will add double quotes and take care of escaping for you.&lt;/P&gt;

&lt;P&gt;Here is the relevant documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.0/Viz/tokens#Token_filters"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.0/Viz/tokens#Token_filters&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I hope this is helpful&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 18:12:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453609#M128354</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-05T18:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453610#M128355</link>
      <description>&lt;P&gt;I guess at the simplest part of this is how can I remove all ":" from a mac address &amp;amp; pass it on to another panel?&lt;/P&gt;

&lt;P&gt;I dont think escapes will work due to its not a quote, Not sure how to escape would work in any case scenerio since ":"'s are throughout the string. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 18:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453610#M128355</guid>
      <dc:creator>clintla</dc:creator>
      <dc:date>2019-02-06T18:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453611#M128356</link>
      <description>&lt;P&gt;What about this: &lt;CODE&gt;YOUR_SEARCH | eval mac_full = "$token$" | eval mac_short = mac_full | rex field=mac_short  mode=sed "s/://g""&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 19:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453611#M128356</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-06T19:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453612#M128357</link>
      <description>&lt;P&gt;You could use eval tokens:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/Viz/tokens#Define_token_filtering_and_formatting"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.3/Viz/tokens#Define_token_filtering_and_formatting&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;eval token="new_token"&amp;gt;replace('mac_address_token', ":", "")&amp;lt;/eval&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 19:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453612#M128357</guid>
      <dc:creator>ccl0utier</dc:creator>
      <dc:date>2019-02-06T19:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you remove special characters from a token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453613#M128358</link>
      <description>&lt;P&gt;"This seems like it would work &lt;/P&gt;

&lt;P&gt;I insert w/  stanza&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" token="WWN1" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Enter WWN&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;replace($WWN1$, ":","")  searchWhenChanged="true"  &lt;/P&gt;

&lt;P&gt;but 2 things are happening. &lt;BR /&gt;
1- Splunk decides when I refresh the dashboard to re-arrange my code&lt;/P&gt;

&lt;P&gt;replace($WWN1$, ":","")  searchWhenChanged="true"  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" token="WWN1" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Enter WWN&amp;lt;/label&amp;gt;
  &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2- it works after I hit "save" when I put the new stanza after the input.. but if I insert another WWN &lt;BR /&gt;
   it never update, if I refresh the page, splunk inverts the code again. "&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 19:11:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-remove-special-characters-from-a-token/m-p/453613#M128358</guid>
      <dc:creator>clintla</dc:creator>
      <dc:date>2019-02-27T19:11:35Z</dc:date>
    </item>
  </channel>
</rss>

