<?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 upload log files to Splunk using REST API? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194695#M38744</link>
    <description>&lt;P&gt;Thanks for this suggestion but just to clarify the documentation for the one shot endpoint states 'The path to the file to be indexed. The file must be locally accessible by the server.' but the process/question is to upload a raw file from the client to the splunk server and not reference a file on the splunk server.&lt;/P&gt;

&lt;P&gt;Assuming we want to use the oneshot endpoint I guess we need to upload the file first with another endpoint? I ll check the reference.&lt;/P&gt;

&lt;P&gt;Going back to 'HEC in the cloud being enabled', pls see my example below. I was getting connection error though I have enabled it and generated a token.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2016 23:23:08 GMT</pubDate>
    <dc:creator>bizmate</dc:creator>
    <dc:date>2016-03-03T23:23:08Z</dc:date>
    <item>
      <title>How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194686#M38735</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;I want to upload log files using Splunk Rest APIs. Can you please share how I can do that&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 17:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194686#M38735</guid>
      <dc:creator>dilippanwar</dc:creator>
      <dc:date>2014-11-06T17:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194687#M38736</link>
      <description>&lt;P&gt;I am curious too, any success ?&lt;/P&gt;

&lt;P&gt;I saw API methods to convert an uploaded file to a lookup&lt;BR /&gt;
&lt;A href="https://:/services/data/lookup-table-files" target="test_blank"&gt;https://:/services/data/lookup-table-files&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;
POST    Create a lookup table file by moving a file from the upload staging area into $SPLUNK_HOME&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/RESTREF/RESTknowledge"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/RESTREF/RESTknowledge&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;What is the method to upload the file to the staging area ?&lt;BR /&gt;
according to this answer  &lt;A href="https://answers.splunk.com/answers/152485/can-you-create-modify-a-lookup-file-via-rest-api.html"&gt;https://answers.splunk.com/answers/152485/can-you-create-modify-a-lookup-file-via-rest-api.html&lt;/A&gt;&lt;BR /&gt;
"But you can't remotely upload a new lookup file with these REST endpoints , you'd need to create a Custom REST Endpoint to do this."&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 18:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194687#M38736</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2015-11-24T18:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194688#M38737</link>
      <description>&lt;P&gt;I am also stuck, I would like to upload logs but I want to gather this data without using the Splunk Forwarder due to limitations on the machines. Any chance this can be achieved or are we still stuck. Look-up tables look like separate things than loading raw data with some tags (like source, type etc) to an index. But I might be wrong of course. Still learning about Splunk&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 23:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194688#M38737</guid>
      <dc:creator>bizmate</dc:creator>
      <dc:date>2016-03-02T23:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194689#M38738</link>
      <description>&lt;P&gt;Hi @bizmate,&lt;BR /&gt;
You might want to see the documentation for the HTTP Event Collector:&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE6M"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAE6M&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and associated REST endpoints:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTinput#services.2Fcollector"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTinput#services.2Fcollector&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTinput#data.2Finputs.2Fhttp"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTinput#data.2Finputs.2Fhttp&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 23:47:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194689#M38738</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-02T23:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194690#M38739</link>
      <description>&lt;P&gt;Hi @frobinson, your suggestion gave me some hope. I am trying splunk with a cloud instance until i can provision a local enterprise instance. I have enabled the token as suggested in the documentation.&lt;BR /&gt;
See - &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE7F"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAE7F&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have tried to upload my application logs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ curl -ki &lt;A href="https://prd-p-XXXXXXX.cloud.splunk.com:8088/services/collector" target="test_blank"&gt;https://prd-p-XXXXXXX.cloud.splunk.com:8088/services/collector&lt;/A&gt; -H 'Authorization: Splunk 61EC1DEF-XXXXXXXXXXXXXXXXXXXXX' -d @application201603031354.log 
curl: (7) Failed to connect to prd-p-XXXXXXX.cloud.splunk.com port 8088: Connection timed out
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The strange thing is that when i set a token I dont get the same screen visible in the documentation, i.e. I dont see a confirmation of the hostname to send the request to. I have popped in on IRC to ask how i could get a confirmation of the hostname, if that was the problem. Also i confirm the EC is enabled in the global configuration so I am stuck right now. Can EC be enabled on the cloud?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 15:05:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194690#M38739</guid>
      <dc:creator>bizmate</dc:creator>
      <dc:date>2016-03-03T15:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194691#M38740</link>
      <description>&lt;P&gt;Hi @bizmate,&lt;BR /&gt;
I didn't realize until your most recent comment that you are on Splunk Cloud. Let me check with our engineering team to see what differences there are and what you can do. I'll report back!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 18:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194691#M38740</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-03T18:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194692#M38741</link>
      <description>&lt;P&gt;Yes, you can upload log data via the API.  Though I would use a forwarder or HTTPEvent collector.&lt;/P&gt;

&lt;P&gt;To upload data you have to use the receivers/simple endpoint using the post method.  The post body will contain the your event using an XML or Json format.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://&amp;lt;host&amp;gt;:&amp;lt;mPort&amp;gt;/services/receivers/simple" target="test_blank"&gt;https://&amp;lt;host&amp;gt;:&amp;lt;mPort&amp;gt;/services/receivers/simple&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTinput#receivers.2Fsimple"&gt;Reciever Example&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTlist"&gt;API summary&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 18:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194692#M38741</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2016-03-03T18:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194693#M38742</link>
      <description>&lt;P&gt;Hi dilippanwar&lt;/P&gt;

&lt;P&gt;HEC is not the best for uploading files. If you are using our JSON format, you need to parse your data and then turn it into our JSON event protocol. Our new Raw endpoint won't require that as it supports arbitrary text, but it is only available in cloud currently, and it has a default size limit of the payload being 1 meg.&lt;/P&gt;

&lt;P&gt;A better option for file upload would be to use our &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/RESTREF/RESTinput#data.2Finputs.2Foneshot"&gt;one shot upload&lt;/A&gt; API as you can send it a file directly.&lt;/P&gt;

&lt;P&gt;In terms of HEC in the cloud being enabled. You can enable it yourself in single instance or trial. For a clustered cloud config, you have to work with support to get the endpoint opened and for token management. You can ask support to open up our REST API (8089) and then use the Splunk CLI / REST API to also manage tokens.&lt;/P&gt;

&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 19:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194693#M38742</guid>
      <dc:creator>gblock_splunk</dc:creator>
      <dc:date>2016-03-03T19:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194694#M38743</link>
      <description>&lt;P&gt;As a follow-up--please see @gblock 's answer and one shot upload suggestion below &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 19:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194694#M38743</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-03T19:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194695#M38744</link>
      <description>&lt;P&gt;Thanks for this suggestion but just to clarify the documentation for the one shot endpoint states 'The path to the file to be indexed. The file must be locally accessible by the server.' but the process/question is to upload a raw file from the client to the splunk server and not reference a file on the splunk server.&lt;/P&gt;

&lt;P&gt;Assuming we want to use the oneshot endpoint I guess we need to upload the file first with another endpoint? I ll check the reference.&lt;/P&gt;

&lt;P&gt;Going back to 'HEC in the cloud being enabled', pls see my example below. I was getting connection error though I have enabled it and generated a token.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 23:23:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194695#M38744</guid>
      <dc:creator>bizmate</dc:creator>
      <dc:date>2016-03-03T23:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194696#M38745</link>
      <description>&lt;P&gt;I downvoted this post because the oneshot endpoint is not for upload of data, as data should be already on the server in the form of a file&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 12:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194696#M38745</guid>
      <dc:creator>bizmate</dc:creator>
      <dc:date>2016-03-04T12:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194697#M38746</link>
      <description>&lt;P&gt;While it's possible to use the UI feature of "upload a file to splunk" and then review the pattern of splunkd_access.log files to see how it accomplishes this, I wouldn't recommend it for production workflow.&lt;/P&gt;

&lt;P&gt;Why don't you simply transfer the files to a location that Splunk monitors on another host?  If you want the data to go away when Splunk completes it, you can transfer the files into a monitored sinkhole.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194697#M38746</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2016-03-04T15:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194698#M38747</link>
      <description>&lt;P&gt;I downvoted this post because it is about uploading log files, no log data in a specific format.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 17:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194698#M38747</guid>
      <dc:creator>leosanchezcasad</dc:creator>
      <dc:date>2018-01-04T17:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to upload log files to Splunk using REST API?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194699#M38748</link>
      <description>&lt;P&gt;My post has nothing to do with format.   It simply states that you can use the rest endpoint post your date.    That endpoint is &lt;A href="https://:/services/receivers/simple" target="test_blank"&gt;https://:/services/receivers/simple&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:45:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-upload-log-files-to-Splunk-using-REST-API/m-p/194699#M38748</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2018-01-04T18:45:04Z</dc:date>
    </item>
  </channel>
</rss>

