<?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 using a search macro inside mvmap, missing ) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/571739#M199232</link>
    <description>&lt;P&gt;Hi Community - I'm trying to extend the Levenshtein distance query in this tutorial: &lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/you-can-t-hyde-from-dr-levenshtein-when-you-use-url-toolbox.html" target="_blank" rel="noopener"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/you-can-t-hyde-from-dr-levenshtein-when-you-use-url-toolbox.html&lt;/A&gt;.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Specifically, I'm trying to evaluate the Levenshtein distance of an email domain against multiple comparison domains on one line, with the resulting values going into a multivalue field. I tried doing this with mvmap:&lt;BR /&gt;&lt;BR /&gt;| eval lev=mvmap(inspect_domains, `ut_levenshtein(ut_domain, inspect_domains)`)&lt;BR /&gt;&lt;BR /&gt;Where inspect_domains is the multivalue field containing comparative domains, and ut_levenshtein is a search macro in the URL Toolbox app .&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;This returns an error: "Error in 'eval' command: The expression is malformed. Expected ). "&lt;BR /&gt;To my eye, the parentheses appear to be balanced. I nevertheless tried adding or removing parentheses to try to make Splunk happy, but no combination of parentheses seems to work&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Any ideas?&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 23:25:32 GMT</pubDate>
    <dc:creator>Cyrus</dc:creator>
    <dc:date>2021-10-20T23:25:32Z</dc:date>
    <item>
      <title>using a search macro inside mvmap, missing )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/571739#M199232</link>
      <description>&lt;P&gt;Hi Community - I'm trying to extend the Levenshtein distance query in this tutorial: &lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/you-can-t-hyde-from-dr-levenshtein-when-you-use-url-toolbox.html" target="_blank" rel="noopener"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/you-can-t-hyde-from-dr-levenshtein-when-you-use-url-toolbox.html&lt;/A&gt;.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Specifically, I'm trying to evaluate the Levenshtein distance of an email domain against multiple comparison domains on one line, with the resulting values going into a multivalue field. I tried doing this with mvmap:&lt;BR /&gt;&lt;BR /&gt;| eval lev=mvmap(inspect_domains, `ut_levenshtein(ut_domain, inspect_domains)`)&lt;BR /&gt;&lt;BR /&gt;Where inspect_domains is the multivalue field containing comparative domains, and ut_levenshtein is a search macro in the URL Toolbox app .&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;This returns an error: "Error in 'eval' command: The expression is malformed. Expected ). "&lt;BR /&gt;To my eye, the parentheses appear to be balanced. I nevertheless tried adding or removing parentheses to try to make Splunk happy, but no combination of parentheses seems to work&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 23:25:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/571739#M199232</guid>
      <dc:creator>Cyrus</dc:creator>
      <dc:date>2021-10-20T23:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: using a search macro inside mvmap, missing )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/571938#M199299</link>
      <description>&lt;P&gt;I don't think mvmap is going to work in that context based on the contents of that specific macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you give this SPL a shot? It's not one line, but it's close and should still get you where you need to go. Unless there is a specific reason it needs to be a one-liner.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval ut_domain="mycampany.com" 
| append 
    [| makeresults 
    | eval ut_domain="mycempany.com" ] 
| mvcombine ut_domain
| eval company_domain ="mycompany.com" 
| fields - _time
| mvexpand ut_domain
|`ut_levenshtein(company_domain, ut_domain)`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 02:31:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/571938#M199299</guid>
      <dc:creator>ryanoconnor</dc:creator>
      <dc:date>2021-10-22T02:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: using a search macro inside mvmap, missing )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/572169#M199416</link>
      <description>&lt;P&gt;Thank you for taking the time to respond. That didn't quite work, but it gave me the idea for a rough solution: by using mvappend to join together all of the email domains I want to inspect against, followed immediately by an mvexpand to generate separate line items per event per domain, I can run the ut_levenshtein macro against everything.&lt;BR /&gt;&lt;BR /&gt;| eval inspect_domains=mvappend("yahoo.com", "google.com", "outlook.com")&lt;BR /&gt;| mvexpand inspect_domains&lt;BR /&gt;| `ut_levenshtein(sender_domain, inspect_domains)`&lt;/P&gt;&lt;P&gt;Not very elegant and may not scale, but it works well enough for now. Thanks again.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 19:36:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-a-search-macro-inside-mvmap-missing/m-p/572169#M199416</guid>
      <dc:creator>Cyrus</dc:creator>
      <dc:date>2021-10-24T19:36:25Z</dc:date>
    </item>
  </channel>
</rss>

