<?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 include arguments in search macros with non-alphanumeric values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696352#M236673</link>
    <description>&lt;P&gt;Use macro params to pass these tokens. &amp;nbsp;Here is an example:&lt;/P&gt;&lt;TABLE width="467px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="106.859375px"&gt;Name&lt;/TD&gt;&lt;TD width="257.171875px"&gt;Definition&lt;/TD&gt;&lt;TD width="101.984375px"&gt;Arguments&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="106.859375px"&gt;non-alphabetic-token(2)&lt;/TD&gt;&lt;TD width="257.171875px"&gt;index=_internal earliest=$earliest_tok$ latest=$latest_tok$&lt;/TD&gt;&lt;TD width="101.984375px"&gt;earliest_tok, latest_tok&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="light"&amp;gt;
  &amp;lt;label&amp;gt;Non-alphabetic tokens&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696333#M236667&amp;lt;/description&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="timepicker" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;pick time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;$timepicker.earliest$&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;`non-alphabetic-token($timepicker.earliest$, $timepicker.latest$)`
| addinfo
| stats count by info_min_time info_max_time
| foreach info_*
    [eval &amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt; = strftime(&amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;, "%F %T")]&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are some sample interactions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="non-alphabetic-token-recent.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32226i0F035623F431A4F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="non-alphabetic-token-recent.png" alt="non-alphabetic-token-recent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="non-alphabetic-token-past.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32227i1974E7E936F9BB72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="non-alphabetic-token-past.png" alt="non-alphabetic-token-past.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2024 06:37:16 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2024-08-15T06:37:16Z</dc:date>
    <item>
      <title>How to include arguments in search macros with non-alphanumeric values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696333#M236667</link>
      <description>&lt;P&gt;I have arguments for my macro that contain other values e.g. $env:user$ and $timepicker.earliest$/$timepicker.latest$. How do I include these in my macro definition as it doesn't allow me since macro arguments must&lt;SPAN&gt;&amp;nbsp;only contain alphanumeric, '_' and '-' characters?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 02:04:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696333#M236667</guid>
      <dc:creator>cherrypick</dc:creator>
      <dc:date>2024-08-15T02:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to include arguments in search macros with non-alphanumeric values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696336#M236668</link>
      <description>&lt;P&gt;Or is there another way to use re-usable SPL searches that can take these values into account?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 02:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696336#M236668</guid>
      <dc:creator>cherrypick</dc:creator>
      <dc:date>2024-08-15T02:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to include arguments in search macros with non-alphanumeric values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696352#M236673</link>
      <description>&lt;P&gt;Use macro params to pass these tokens. &amp;nbsp;Here is an example:&lt;/P&gt;&lt;TABLE width="467px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="106.859375px"&gt;Name&lt;/TD&gt;&lt;TD width="257.171875px"&gt;Definition&lt;/TD&gt;&lt;TD width="101.984375px"&gt;Arguments&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="106.859375px"&gt;non-alphabetic-token(2)&lt;/TD&gt;&lt;TD width="257.171875px"&gt;index=_internal earliest=$earliest_tok$ latest=$latest_tok$&lt;/TD&gt;&lt;TD width="101.984375px"&gt;earliest_tok, latest_tok&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="light"&amp;gt;
  &amp;lt;label&amp;gt;Non-alphabetic tokens&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696333#M236667&amp;lt;/description&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="timepicker" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;pick time&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;$timepicker.earliest$&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;`non-alphabetic-token($timepicker.earliest$, $timepicker.latest$)`
| addinfo
| stats count by info_min_time info_max_time
| foreach info_*
    [eval &amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt; = strftime(&amp;amp;lt;&amp;amp;lt;FIELD&amp;amp;gt;&amp;amp;gt;, "%F %T")]&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are some sample interactions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="non-alphabetic-token-recent.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32226i0F035623F431A4F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="non-alphabetic-token-recent.png" alt="non-alphabetic-token-recent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="non-alphabetic-token-past.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32227i1974E7E936F9BB72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="non-alphabetic-token-past.png" alt="non-alphabetic-token-past.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 06:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696352#M236673</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-08-15T06:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to include arguments in search macros with non-alphanumeric values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696359#M236674</link>
      <description>&lt;P&gt;I'm not sure you understand the macros correctly.&lt;/P&gt;&lt;P&gt;if you define a macro with two parameters paramA and paramB it will get substituted in your search with whatever values you specify for them. These are separate layers.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 08:25:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696359#M236674</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-15T08:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to include arguments in search macros with non-alphanumeric values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696444#M236694</link>
      <description>&lt;P&gt;Amazing! Thank you. Yes I misunderstood macros.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 03:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-include-arguments-in-search-macros-with-non-alphanumeric/m-p/696444#M236694</guid>
      <dc:creator>cherrypick</dc:creator>
      <dc:date>2024-08-16T03:07:29Z</dc:date>
    </item>
  </channel>
</rss>

