<?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 replace all &amp;quot;confusable&amp;quot; characters in field in data model? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635394#M220749</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="" href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957" target="_self"&gt;&lt;SPAN class=""&gt;richgalloway&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, unfortunately that doesn't do what I need it to do. replace searches for the whole given string to replace. I want to do what sed does with "y/", where it's a one-on-one replacement.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 19:47:15 GMT</pubDate>
    <dc:creator>jasmartin</dc:creator>
    <dc:date>2023-03-21T19:47:15Z</dc:date>
    <item>
      <title>How to replace all "confusable" characters in field in data model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635353#M220730</link>
      <description>&lt;P&gt;Hello, I am attempting to replace a large unwieldy macro with a data model. Part of the macro is a rex command that finds what we call "confusable characters" that are the highbit versions of ASCII characters, like&amp;nbsp;𝟐 or&amp;nbsp;ꓜ, and replaces them with the ASCII versions (2 or Z respectively), like this:&lt;/P&gt;
&lt;PRE&gt;rex field=$arg1$ mode=sed "y/𝟐𝟚𝟤𝟮𝟸ꝚƧϨꙄᒿꛯ/22222222222/"&lt;/PRE&gt;
&lt;P&gt;The actual macro is much longer and encompasses all numbers and letters.&lt;/P&gt;
&lt;P&gt;I have been having difficultly figuring out how to incorporate this into the data model. I've been able to use a CSV lookup like this:&lt;/P&gt;
&lt;PRE&gt;char_search,old_char,new_char&lt;BR /&gt;*𝟐*,𝟐,2&lt;BR /&gt;*ꓜ*,ꓜ,Z&lt;/PRE&gt;
&lt;P&gt;Make char_search a wildcard match field, and use this query:&lt;/P&gt;
&lt;PRE&gt;| makeresults&lt;BR /&gt;| eval t="dfasdf𝟐𝟐"&lt;BR /&gt;| lookup CSVconfusables char_search as t OUTPUT&lt;BR /&gt;| eval u=replace(t,old_char,new_char)&lt;/PRE&gt;
&lt;P&gt;It works find with 1 character to replace, but when there are multiple to replace, the lookup output fields become multivalue and replace doesn't work:&lt;/P&gt;
&lt;PRE&gt;| makeresults&lt;BR /&gt;| eval t="ꓜdfasdf𝟐𝟐"&lt;BR /&gt;| lookup CSVconfusables char_search as t OUTPUT&lt;BR /&gt;| eval u=replace(t,old_char,new_char)&lt;/PRE&gt;
&lt;P&gt;Is there any way to accomplish what the macro is doing in a data model? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 16:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635353#M220730</guid>
      <dc:creator>jasmartin</dc:creator>
      <dc:date>2023-03-21T16:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace all "confusable" characters in field in data model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635390#M220747</link>
      <description>&lt;P&gt;Since the &lt;FONT face="courier new,courier"&gt;replace&lt;/FONT&gt; function uses regular expressions as does &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt;, have you tried putting the expressions from the macro into the DM?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval arg1=replace(arg1,"𝟐𝟚𝟤𝟮𝟸ꝚƧϨꙄᒿꛯ","22222222222")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 19:27:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635390#M220747</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-03-21T19:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace all "confusable" characters in field in data model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635394#M220749</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="" href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957" target="_self"&gt;&lt;SPAN class=""&gt;richgalloway&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, unfortunately that doesn't do what I need it to do. replace searches for the whole given string to replace. I want to do what sed does with "y/", where it's a one-on-one replacement.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 19:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635394#M220749</guid>
      <dc:creator>jasmartin</dc:creator>
      <dc:date>2023-03-21T19:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace all "confusable" characters in field in data model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635407#M220756</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;'s idea was close. If I understand you well, you need something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval arg1=replace(arg1,"[𝟐𝟚𝟤𝟮𝟸ꝚƧϨꙄᒿꛯ]","2")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 22:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635407#M220756</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-21T22:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace all "confusable" characters in field in data model?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635484#M220784</link>
      <description>&lt;P&gt;That will work, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 10:44:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-all-quot-confusable-quot-characters-in-field-in/m-p/635484#M220784</guid>
      <dc:creator>jasmartin</dc:creator>
      <dc:date>2023-03-22T10:44:08Z</dc:date>
    </item>
  </channel>
</rss>

