<?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 Splunk custom search command : call other splunk commands in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-custom-search-command-call-other-splunk-commands/m-p/537021#M9656</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a custom search command that need some preformated input. To do so, I always run my command with the same splunk commands before :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| eval a=b+c
| stats count by a
| bin ...
| my_custom_command(count,a,b,c)&lt;/LI-CODE&gt;&lt;P&gt;Hence, i have created a macro to wrap all this code, so I only have to call my macro :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | `my_macro(b,c)`&lt;/LI-CODE&gt;&lt;P&gt;The problem is because it is a macro, it does not have the description of the searchbnf.conf for "my_custom_command".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would like to edit the code of "my_custom_command" to "embed" the splunk commands i always run&amp;nbsp; (the stats, bin, eval connands) before running my own code. Is there a way to do so ?&lt;BR /&gt;If no, is there a way to create a searchbnf for a macro ?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 10:10:50 GMT</pubDate>
    <dc:creator>alfreddupont012</dc:creator>
    <dc:date>2021-01-25T10:10:50Z</dc:date>
    <item>
      <title>Splunk custom search command : call other splunk commands</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Splunk-custom-search-command-call-other-splunk-commands/m-p/537021#M9656</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a custom search command that need some preformated input. To do so, I always run my command with the same splunk commands before :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| eval a=b+c
| stats count by a
| bin ...
| my_custom_command(count,a,b,c)&lt;/LI-CODE&gt;&lt;P&gt;Hence, i have created a macro to wrap all this code, so I only have to call my macro :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | `my_macro(b,c)`&lt;/LI-CODE&gt;&lt;P&gt;The problem is because it is a macro, it does not have the description of the searchbnf.conf for "my_custom_command".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would like to edit the code of "my_custom_command" to "embed" the splunk commands i always run&amp;nbsp; (the stats, bin, eval connands) before running my own code. Is there a way to do so ?&lt;BR /&gt;If no, is there a way to create a searchbnf for a macro ?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 10:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Splunk-custom-search-command-call-other-splunk-commands/m-p/537021#M9656</guid>
      <dc:creator>alfreddupont012</dc:creator>
      <dc:date>2021-01-25T10:10:50Z</dc:date>
    </item>
  </channel>
</rss>

