<?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: Is there a REST API call to rebuild the forwarder asset table? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251506#M48422</link>
    <description>&lt;P&gt;I have a slightly different requirement where the missing forwarders would blow out due to constantly changing Citrix clients, so my first comment below about dismissing the "DMC Forwarder - Build Asset Table" is because its appending to the existing table.&lt;/P&gt;

&lt;P&gt;If you check the Job Activity page on the Monitoring Console you will see two jobs that show up:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1. DMC Forwarder - Build Asset Table
2. `dmc_re_build_forwarder_assets(48m)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first is scheduled to run every 15 minutes and can be ignored.&lt;BR /&gt;
The second is the job that is initiated when you "Rebuild forwarder assets" (previous 24 hours defines the 48m sparkline argument), this is what we are interested in.&lt;BR /&gt;
If you follow the bouncing ball you can figure out what it's doing yourself, to get you started:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#  grep "dmc_re_build_forwarder_assets(1)" /opt/splunk/etc/apps/splunk_monitoring_console/default/macros.conf
[dmc_re_build_forwarder_assets(1)]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd then recommend you create a scheduled search with "&lt;CODE&gt;dmc_re_build_forwarder_assets(48m)&lt;/CODE&gt;".&lt;BR /&gt;
This can then be called via REST:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl --silent -k -u admin https://localhost:8089/servicesNS/admin/splunk_monitoring_console/saved/searches/YOUR_SAVED_SEARCH/dispatch -d trigger_actions=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you're security conscious and want to put this into a then I'd recommend doing two things:&lt;BR /&gt;
  1. &lt;A href="https://stackoverflow.com/questions/33794842/forcing-curl-to-get-a-password-from-the-environment/33818945#33818945" target="_blank"&gt;https://stackoverflow.com/questions/33794842/forcing-curl-to-get-a-password-from-the-environment/33818945#33818945&lt;/A&gt;&lt;BR /&gt;
  2. Create a dedicated user and role&lt;/P&gt;

&lt;P&gt;The role can be tightend and given just the below:&lt;BR /&gt;
  Restrict search terms: index=_internal sourcetype=splunkd&lt;BR /&gt;
  Capabilities: admin_all_objects, output_file, search&lt;BR /&gt;
  Available search indexes: _internal&lt;/P&gt;

&lt;P&gt;I kept running into permission issues unless I gave the "admin_all_objects" capabilitiy. Not sure if I missed something or if this is due to some Monitoring Console magic.&lt;BR /&gt;
The capabilities above are fairly locked down, so I feel like it is a reasonable compromise.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:30:31 GMT</pubDate>
    <dc:creator>dd_msearles</dc:creator>
    <dc:date>2020-09-29T20:30:31Z</dc:date>
    <item>
      <title>Is there a REST API call to rebuild the forwarder asset table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251504#M48420</link>
      <description>&lt;P&gt;Is there an API call that can rebuild the forwarder asset table as opposed to going into the Distributed Management Console settings and manually doing so through Splunk Web?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 15:18:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251504#M48420</guid>
      <dc:creator>sarahkrisher</dc:creator>
      <dc:date>2016-07-11T15:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a REST API call to rebuild the forwarder asset table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251505#M48421</link>
      <description>&lt;P&gt;To rebuild the forwarder asset table, you simply have to run the "DMC Forwarder - Build Asset Table" saved search with earliest and latest times that cover the lookback period that you want to consider.&lt;/P&gt;

&lt;P&gt;To do so from the REST API, you'd have to POST to the &lt;CODE&gt;saved/searches/{name}/dispatch&lt;/CODE&gt; endpoint for this search - &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D.2Fdispatch"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/RESTREF/RESTsearch#saved.2Fsearches.2F.7Bname.7D.2Fdispatch&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 19:31:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251505#M48421</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2016-08-05T19:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a REST API call to rebuild the forwarder asset table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251506#M48422</link>
      <description>&lt;P&gt;I have a slightly different requirement where the missing forwarders would blow out due to constantly changing Citrix clients, so my first comment below about dismissing the "DMC Forwarder - Build Asset Table" is because its appending to the existing table.&lt;/P&gt;

&lt;P&gt;If you check the Job Activity page on the Monitoring Console you will see two jobs that show up:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1. DMC Forwarder - Build Asset Table
2. `dmc_re_build_forwarder_assets(48m)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first is scheduled to run every 15 minutes and can be ignored.&lt;BR /&gt;
The second is the job that is initiated when you "Rebuild forwarder assets" (previous 24 hours defines the 48m sparkline argument), this is what we are interested in.&lt;BR /&gt;
If you follow the bouncing ball you can figure out what it's doing yourself, to get you started:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#  grep "dmc_re_build_forwarder_assets(1)" /opt/splunk/etc/apps/splunk_monitoring_console/default/macros.conf
[dmc_re_build_forwarder_assets(1)]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd then recommend you create a scheduled search with "&lt;CODE&gt;dmc_re_build_forwarder_assets(48m)&lt;/CODE&gt;".&lt;BR /&gt;
This can then be called via REST:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl --silent -k -u admin https://localhost:8089/servicesNS/admin/splunk_monitoring_console/saved/searches/YOUR_SAVED_SEARCH/dispatch -d trigger_actions=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you're security conscious and want to put this into a then I'd recommend doing two things:&lt;BR /&gt;
  1. &lt;A href="https://stackoverflow.com/questions/33794842/forcing-curl-to-get-a-password-from-the-environment/33818945#33818945" target="_blank"&gt;https://stackoverflow.com/questions/33794842/forcing-curl-to-get-a-password-from-the-environment/33818945#33818945&lt;/A&gt;&lt;BR /&gt;
  2. Create a dedicated user and role&lt;/P&gt;

&lt;P&gt;The role can be tightend and given just the below:&lt;BR /&gt;
  Restrict search terms: index=_internal sourcetype=splunkd&lt;BR /&gt;
  Capabilities: admin_all_objects, output_file, search&lt;BR /&gt;
  Available search indexes: _internal&lt;/P&gt;

&lt;P&gt;I kept running into permission issues unless I gave the "admin_all_objects" capabilitiy. Not sure if I missed something or if this is due to some Monitoring Console magic.&lt;BR /&gt;
The capabilities above are fairly locked down, so I feel like it is a reasonable compromise.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-there-a-REST-API-call-to-rebuild-the-forwarder-asset-table/m-p/251506#M48422</guid>
      <dc:creator>dd_msearles</dc:creator>
      <dc:date>2020-09-29T20:30:31Z</dc:date>
    </item>
  </channel>
</rss>

