<?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: HTTP event collector basic questions in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666010#M17707</link>
    <description>&lt;P&gt;No.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; already told you - the &lt;STRONG&gt;-d "something" &lt;/STRONG&gt;option sends the data you specify on the command line. If you want the data to be read from the file you have to specify it as the source for the POST data with the &lt;STRONG&gt;-d @filename&lt;/STRONG&gt; option. And there is no "templating" you just specify raw data to be posted. So it will not work like "get a part of the data from the command line and iterate some file's contents over it".&lt;/P&gt;&lt;P&gt;No - if you want something like that, you have to implement it manually (bash scripting, python, PowerShell, whatever).&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 14:22:32 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2023-10-24T14:22:32Z</dc:date>
    <item>
      <title>HTTP event collector basic questions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/665965#M17699</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;In the example below, I clearly understand that the "hello world" will be updated in a Splunk event&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "time": 1426279439, // epoch time
    "host": "localhost",
    "source": "random-data-generator",
    "sourcetype": "my_sample_data",
    "index": "main",
    "event":  "Hello world!" 
}

curl -H "Authorization: Splunk 12345678-1234-1234-1234-1234567890AB" https://localhost:8088/services/collector/event -d '{"event":"hello world"}'&lt;/LI-CODE&gt;&lt;P&gt;Now imagine that my json file contains many items like below&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "time": 1426279439, // epoch time
    "host": "localhost",
    "source": "random-data-generator",
    "sourcetype": "my_sample_data",
    "index": "main",
    "event":  "Hello world!" 
}

{
    "time": 1426279538, // epoch time
    "host": "localhost",
    "source": "random-data-generator",
    "sourcetype": "my_sample_data",
    "index": "main",
    "event":  "Hello eveybody!" 
}&lt;/LI-CODE&gt;&lt;P&gt;Is the curl command to use should be like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Splunk 12345678-1234-1234-1234-1234567890AB" https://localhost:8088/services/collector/event -d '{"event":}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Last question : instead using a prompt command to send the json logs in Splunk, is it possible to use a json script to do that? Or something else&lt;/P&gt;&lt;P&gt;Is anybody has good examples of that?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 04:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/665965#M17699</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-10-24T04:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector basic questions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/665974#M17701</link>
      <description>&lt;P&gt;Not sure I understand your examples, as you indicate the data is in a file, but you are not sending that file, only the data following the &lt;STRONG&gt;-d&lt;/STRONG&gt; curl option. To send a file, you use &lt;STRONG&gt;-d&amp;nbsp;@filename&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 08:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/665974#M17701</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-10-24T08:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector basic questions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666003#M17704</link>
      <description>&lt;P&gt;Also remember that json does not support comments.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 13:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666003#M17704</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-10-24T13:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector basic questions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666007#M17706</link>
      <description>&lt;P&gt;not sure you understood my question&lt;/P&gt;&lt;P&gt;the curl command below create an event with "hello world"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Splunk 12345678-1234-1234-1234-1234567890AB" https://localhost:8088/services/collector/event -d '{"event":"hello world"}'&lt;/LI-CODE&gt;&lt;P&gt;imagine that in my json file I have many items with a different event name&lt;/P&gt;&lt;P&gt;for example "hello world", "hello world1", "hello world2".....&lt;/P&gt;&lt;P&gt;is the good curl command to apply is like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -H "Authorization: Splunk 12345678-1234-1234-1234-1234567890AB" https://localhost:8088/services/collector/event -d '{"event":}'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;what i mean is that if i dont mention the name of the event, 3 events will be created in splunk with&amp;nbsp;"hello world", "hello world1", "hello world2"?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 14:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666007#M17706</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2023-10-24T14:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP event collector basic questions</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666010#M17707</link>
      <description>&lt;P&gt;No.&lt;/P&gt;&lt;P&gt;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt; already told you - the &lt;STRONG&gt;-d "something" &lt;/STRONG&gt;option sends the data you specify on the command line. If you want the data to be read from the file you have to specify it as the source for the POST data with the &lt;STRONG&gt;-d @filename&lt;/STRONG&gt; option. And there is no "templating" you just specify raw data to be posted. So it will not work like "get a part of the data from the command line and iterate some file's contents over it".&lt;/P&gt;&lt;P&gt;No - if you want something like that, you have to implement it manually (bash scripting, python, PowerShell, whatever).&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 14:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/HTTP-event-collector-basic-questions/m-p/666010#M17707</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-10-24T14:22:32Z</dc:date>
    </item>
  </channel>
</rss>

