<?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 How do I ship json file uusing HTTP Event Collector? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-ship-json-file-uusing-HTTP-Event-Collector/m-p/645371#M109811</link>
    <description>&lt;P&gt;I'm trying to shipa json data set, my code is working fine for file size less than 10kb, but is failing for higher file sizes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import pandas as pd
import requests
import json

with open('empire_psremoting_stager_2020-09-20170827.json') as file:
    data = pd.read_json(file, lines=True)

index_count = data.shape[0]

for count in range(index_count):
    logs = data.loc[count]
    for index, value in logs.items():
        logs = f"{index}: {value}"
    logs = str(data.loc[count]) # Convert DataFrame row to dictionary
    url = "https://xxx-xxx-xxx.splunkcloud.com:8088/services/collector"
    headers = {
        "Authorization": "Splunk xxx-xxx-xxx-xxx-xxx"
    }

    payload = {
        "event": logs
    }

    response = requests.post(url, headers=headers, data=json.dumps(payload), verify=False)

    if response.status_code == 200:
        print("Data sent")
    else:
        print("Failed", response.status_code, response.reason)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does any one have other alternatives? or can look at my code.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 14:09:48 GMT</pubDate>
    <dc:creator>eventcollector</dc:creator>
    <dc:date>2023-06-01T14:09:48Z</dc:date>
    <item>
      <title>How do I ship json file uusing HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-ship-json-file-uusing-HTTP-Event-Collector/m-p/645371#M109811</link>
      <description>&lt;P&gt;I'm trying to shipa json data set, my code is working fine for file size less than 10kb, but is failing for higher file sizes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import pandas as pd
import requests
import json

with open('empire_psremoting_stager_2020-09-20170827.json') as file:
    data = pd.read_json(file, lines=True)

index_count = data.shape[0]

for count in range(index_count):
    logs = data.loc[count]
    for index, value in logs.items():
        logs = f"{index}: {value}"
    logs = str(data.loc[count]) # Convert DataFrame row to dictionary
    url = "https://xxx-xxx-xxx.splunkcloud.com:8088/services/collector"
    headers = {
        "Authorization": "Splunk xxx-xxx-xxx-xxx-xxx"
    }

    payload = {
        "event": logs
    }

    response = requests.post(url, headers=headers, data=json.dumps(payload), verify=False)

    if response.status_code == 200:
        print("Data sent")
    else:
        print("Failed", response.status_code, response.reason)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does any one have other alternatives? or can look at my code.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 14:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-ship-json-file-uusing-HTTP-Event-Collector/m-p/645371#M109811</guid>
      <dc:creator>eventcollector</dc:creator>
      <dc:date>2023-06-01T14:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ship json file uusing HTTP Event Collector?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-ship-json-file-uusing-HTTP-Event-Collector/m-p/645755#M109866</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;In default there is a max Content-Length for inputs and it's 10k. Here is more about it&amp;nbsp;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/handling-http-event-collector-hec-content-length-too-large-errors-without-pulling-your-hair-out.html" target="_blank"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/handling-http-event-collector-hec-content-length-too-large-errors-without-pulling-your-hair-out.html&lt;/A&gt;. Even they told to change that limit on .../etc/system/local/limits.conf I prefer to create a separate app where you add this change.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 12:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-ship-json-file-uusing-HTTP-Event-Collector/m-p/645755#M109866</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-05T12:00:03Z</dc:date>
    </item>
  </channel>
</rss>

