<?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 create a search lookup macro to output enriching field names appended to passed matching field name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594917#M207033</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245147"&gt;@jc28187&lt;/a&gt;&amp;nbsp;- Use this (what is provided by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;) as definition of macro.&lt;/P&gt;&lt;P&gt;* Use&amp;nbsp;&lt;STRONG&gt;address_field&lt;/STRONG&gt; in the args.&lt;/P&gt;&lt;P&gt;* Use&amp;nbsp;&lt;STRONG&gt;my_macro(1)&lt;/STRONG&gt; as the name of the macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your macros.conf entry would look something like this if you are adding macro from the backend:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[my_macro(1)]
definition = | lookup lookup_address.csv address as $address_field$ output WHOIS as $address_field$_WHOIS Severity as $address_field$_Severity lastCheck as $address_field$_lastCheck
args = address_field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!! Upvote would be appreciated!!!&lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2022 17:23:59 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2022-04-22T17:23:59Z</dc:date>
    <item>
      <title>How to create a search lookup macro to output enriching field names appended to passed matching field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594905#M207028</link>
      <description>&lt;P&gt;I'm trying to create a search macro which accepts a field to match on and enriches the results with matches and outputs those enriching fields appending the matching value's matching field name as the new field names.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;`my_macro(sourceAddress)`&lt;/P&gt;
&lt;P&gt;Should output the following field names (if it matches):&lt;/P&gt;
&lt;P&gt;sourceAddress_WHOIS&lt;BR /&gt;sourceAddress_Severity&lt;BR /&gt;sourceAddress_lastCheck&lt;/P&gt;
&lt;P&gt;Where WHOIS, Severity, and lastCheck are field names in the lookup table.&lt;/P&gt;
&lt;P&gt;This should also exhibit the same behavior, dynamically, for `my_macro(destinationAddress)`:&lt;/P&gt;
&lt;P&gt;destinationAddress_WHOIS&lt;BR /&gt;destinationAddress_Severity&lt;BR /&gt;destinationAddress_lastCheck&lt;/P&gt;
&lt;P&gt;This macro may be called multiple times against multiple field names in a single search.&amp;nbsp; destinationAddress, sourceAddress, clientAddress, proxyAddress, and more are all potential field names in the searches this macro would be used for and multiple combinations of each can potentially exist in each result.&amp;nbsp; I'd like to be able to clearly see which fields were enriched by the lookup table, if enrichment occurred.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 16:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594905#M207028</guid>
      <dc:creator>jc28187</dc:creator>
      <dc:date>2022-04-22T16:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search lookup macro to output enriching field names appended to passed matching field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594911#M207031</link>
      <description>&lt;LI-CODE lang="markup"&gt;| lookup lookup_address.csv address as $address_field$ output WHOIS as $address_field$_WHOIS Severity as $address_field$_Severity lastCheck as $address_field$_lastCheck&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Apr 2022 16:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594911#M207031</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-22T16:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search lookup macro to output enriching field names appended to passed matching field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594917#M207033</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245147"&gt;@jc28187&lt;/a&gt;&amp;nbsp;- Use this (what is provided by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;) as definition of macro.&lt;/P&gt;&lt;P&gt;* Use&amp;nbsp;&lt;STRONG&gt;address_field&lt;/STRONG&gt; in the args.&lt;/P&gt;&lt;P&gt;* Use&amp;nbsp;&lt;STRONG&gt;my_macro(1)&lt;/STRONG&gt; as the name of the macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your macros.conf entry would look something like this if you are adding macro from the backend:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[my_macro(1)]
definition = | lookup lookup_address.csv address as $address_field$ output WHOIS as $address_field$_WHOIS Severity as $address_field$_Severity lastCheck as $address_field$_lastCheck
args = address_field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!! Upvote would be appreciated!!!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 17:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594917#M207033</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-22T17:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a search lookup macro to output enriching field names appended to passed matching field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594923#M207035</link>
      <description>&lt;P&gt;I had to remove the preceding pipe in the macro definition and this solution worked just fine.&lt;/P&gt;&lt;P&gt;I was trying to over-engineer something using evals to generate field names in values and then use those values to create the field names then use "field -" to remove the fields generated by the lookup after the values were copied to the new eval'd fields...&amp;nbsp; It was a circus.&lt;/P&gt;&lt;P&gt;Thank you for helping me tame it.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 17:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-search-lookup-macro-to-output-enriching-field/m-p/594923#M207035</guid>
      <dc:creator>jc28187</dc:creator>
      <dc:date>2022-04-22T17:31:06Z</dc:date>
    </item>
  </channel>
</rss>

