<?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: Can I create a new index using the REST API? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488597#M83607</link>
    <description>&lt;P&gt;You don't need to reboot splunk for index additions.&lt;/P&gt;

&lt;P&gt;You just need to update indexes.conf and then hit the debug refresh endpoint for indexes or for everything if you prefer.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2020 17:45:00 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2020-01-17T17:45:00Z</dc:date>
    <item>
      <title>Can I create a new index using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488596#M83606</link>
      <description>&lt;P&gt;I am using something pretty similar to this in my transforms.conf to dynamically put events in the desired indexes.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/150266/dynamic-index-assignment-based-on-event-or-log-prefix.html"&gt;https://answers.splunk.com/answers/150266/dynamic-index-assignment-based-on-event-or-log-prefix.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;There are situations where the index doesnt' quite exist yet. When that happens the file sink-holes into the ether, not to be ingested, nor kept in the original directory.&lt;/P&gt;

&lt;P&gt;I'm looking to write some code to get in front of it, and &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;watch the directories&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;ensure the appropriate index exists&lt;/STRONG&gt; &lt;/LI&gt;
&lt;LI&gt;then drop the file in the Splunk-watched directory (or maybe use the api/cli to directly ingest the file in Splunk to the correct index).&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;This is not a clustered Splunk, though if required, it is possible.  (I came across this question &lt;A href="https://answers.splunk.com/answers/387133/how-to-create-index-using-rest-api-in-a-clustered.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev"&gt;https://answers.splunk.com/answers/387133/how-to-create-index-using-rest-api-in-a-clustered.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;My concern is that the solution is pointing to something like editing the indexes.conf file and rebooting splunk through the command line.   Is this possible via REST API? I would also prefer not to have to reboot and kick the users off.  What does the Splunk UI use to do it?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 15:44:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488596#M83606</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2020-01-17T15:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new index using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488597#M83607</link>
      <description>&lt;P&gt;You don't need to reboot splunk for index additions.&lt;/P&gt;

&lt;P&gt;You just need to update indexes.conf and then hit the debug refresh endpoint for indexes or for everything if you prefer.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 17:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488597#M83607</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-01-17T17:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new index using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488598#M83608</link>
      <description>&lt;P&gt;Something like a post to &lt;A href="http://splunkserver:8000/en-US/debug/refresh?entity=indexes"&gt;http://splunkserver:8000/en-US/debug/refresh?entity=indexes&lt;/A&gt; should work&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 17:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488598#M83608</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-01-17T17:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new index using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488599#M83609</link>
      <description>&lt;P&gt;This is helpful, thank you.    Is that what the UI does when you create an index?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 19:18:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488599#M83609</guid>
      <dc:creator>hiddenkirby</dc:creator>
      <dc:date>2020-01-17T19:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new index using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488600#M83610</link>
      <description>&lt;P&gt;Yes or something very similar. &lt;/P&gt;

&lt;P&gt;You could install something like Teleriks Fiddler on your device and see exactly what posts/gets are made when you click on buttons in the UI.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 20:37:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-create-a-new-index-using-the-REST-API/m-p/488600#M83610</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-01-17T20:37:20Z</dc:date>
    </item>
  </channel>
</rss>

