<?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 can I create and update a sourcetype using the REST API? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/669033#M112162</link>
    <description>&lt;P&gt;Turns out the required approach was different from what I had imagined, and in fact rather simpler. What I needed to do was:&lt;/P&gt;
&lt;P&gt;1. Load my data file (in this case a sample log file)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;Set up my index:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -k -u &amp;lt;user&amp;gt;:&amp;lt;password&amp;gt; https://localhost:8089/servicesNS/admin/search/data/indexes -d name=&amp;lt;index-name&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;3. Monitor the log directory, assigning to it the required source type:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -k -u &amp;lt;user&amp;gt;:&amp;lt;password&amp;gt; https://localhost:8089/servicesNS/nobody/search/data/inputs/monitor -d name="/path/to/my/logs" -d index=&amp;lt;index-name&amp;gt; -d host=&amp;lt;host-name&amp;gt; -d sourcetype=&amp;lt;required-source-type&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;All events from that source will be assigned the required source type.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 16:56:36 GMT</pubDate>
    <dc:creator>Mozzieman</dc:creator>
    <dc:date>2023-11-17T16:56:36Z</dc:date>
    <item>
      <title>How can I create and update a sourcetype using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659077#M111463</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've been hunting through the &lt;A title="REST API Documentation" href="https://docs.splunk.com/Documentation/Splunk/9.1.1/RESTREF/RESTprolog" target="_self"&gt;REST API Documentation&lt;/A&gt;&amp;nbsp;, as well as searching online, for the correct endpoint/curl request for maintaining sourcetypes, but haven't found anything. It is a trivial task using the UI, but my use case is that I want to spin up a splunk instance using a script, as part of an automated test process, so UI input won' meet the requirement.&lt;/P&gt;&lt;P&gt;Can anyone point me in the right direction?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 13:05:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659077#M111463</guid>
      <dc:creator>Mozzieman</dc:creator>
      <dc:date>2023-09-29T13:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create and update a sourcetype using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659081#M111466</link>
      <description>&lt;P&gt;Given that a sourcetype is just a stanza name in a props.conf file, I think you need either the &lt;FONT face="courier new,courier"&gt;configs/conf-props&lt;/FONT&gt; endpoint or the &lt;FONT face="courier new,courier"&gt;properties/props&lt;/FONT&gt; endpoint.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 13:33:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659081#M111466</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-09-29T13:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create and update a sourcetype using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659085#M111467</link>
      <description>&lt;P&gt;Thanks for your swift reply! I haven't got the whole answer yet, but that certainly helps as I was not aware of how the config works. Seems like it is probably the local/props.conf file that I need to be updating, referencing &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.1/Admin/Propsconf#Sourcetype_configuration" target="_self"&gt;this spec&lt;/A&gt;. I will do some more research and post a full answer when I have one&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 14:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659085#M111467</guid>
      <dc:creator>Mozzieman</dc:creator>
      <dc:date>2023-09-29T14:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create and update a sourcetype using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659092#M111469</link>
      <description>&lt;P&gt;Yes, you should update a local config file and (almost) never a default file.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 16:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/659092#M111469</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-09-29T16:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create and update a sourcetype using the REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/669033#M112162</link>
      <description>&lt;P&gt;Turns out the required approach was different from what I had imagined, and in fact rather simpler. What I needed to do was:&lt;/P&gt;
&lt;P&gt;1. Load my data file (in this case a sample log file)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;Set up my index:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -k -u &amp;lt;user&amp;gt;:&amp;lt;password&amp;gt; https://localhost:8089/servicesNS/admin/search/data/indexes -d name=&amp;lt;index-name&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;3. Monitor the log directory, assigning to it the required source type:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -k -u &amp;lt;user&amp;gt;:&amp;lt;password&amp;gt; https://localhost:8089/servicesNS/nobody/search/data/inputs/monitor -d name="/path/to/my/logs" -d index=&amp;lt;index-name&amp;gt; -d host=&amp;lt;host-name&amp;gt; -d sourcetype=&amp;lt;required-source-type&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;All events from that source will be assigned the required source type.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 16:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-create-and-update-a-sourcetype-using-the-REST-API/m-p/669033#M112162</guid>
      <dc:creator>Mozzieman</dc:creator>
      <dc:date>2023-11-17T16:56:36Z</dc:date>
    </item>
  </channel>
</rss>

