<?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: XSIAM HTTP Log Collector  Testing in Cortex XSIAM Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262936#M476</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I tested the example in the documentation, and I could not get it to work until I fixed the single/double quotes.&lt;/P&gt;
&lt;P&gt;Please test by replacing them as such:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;body = '{"example": "test", "timestamp": 1609100113039}\n{"example2": [12321,546456,45687,1]}'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Raúl&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2026 22:55:19 GMT</pubDate>
    <dc:creator>rpasca</dc:creator>
    <dc:date>2026-08-26T22:55:19Z</dc:date>
    <item>
      <title>XSIAM HTTP Log Collector  Testing</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262933#M475</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are currently considering to us a HTTP Log Collector.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, before this can be started, I wanted to test the collection.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, in theory, this should not be hard, due to the examples provided after setting up the integration.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Nonetheless, either the Python Example is faulty in some way, or I am being exceedingly stupid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently, my code looks like this, very close to the provided example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def test_http_collector(api_key: str) -&amp;gt; requests.Response:
    headers = {
        "Authorization": api_key,
        "Content-Type": "text/plain"
    }
    # Note: the logs must be separated by a new line
    body = "{'example1': 'test', 'timestamp': 1609100113039}\n{'example2': [12321,546456,45687,1]}"
    res = requests.post(url="https://api-&amp;lt;name&amp;gt;.xdr.de.paloaltonetworks.com/logs/v1/event",
                        headers=headers,
                        data=body,
                        timeout=600
                        )
    return res&lt;/LI-CODE&gt;
&lt;P&gt;I've only added a timeout and changed the linebreak (which would not add a newline) to a \n.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This consistently seems to return HTTP 500 for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best I've managed in trying multiple ways for hours is HTTP 400 and I cannot even replicate it right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does someone who is running a working HTTP log collector have any idea?&lt;/P&gt;
&lt;P&gt;Or maybe a tested and proven, minimal working example?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there anywhere I can check what actually happened in XSIAM?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2026 16:40:22 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262933#M475</guid>
      <dc:creator>J.Huchtktter</dc:creator>
      <dc:date>2026-08-26T16:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: XSIAM HTTP Log Collector  Testing</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262936#M476</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I tested the example in the documentation, and I could not get it to work until I fixed the single/double quotes.&lt;/P&gt;
&lt;P&gt;Please test by replacing them as such:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;body = '{"example": "test", "timestamp": 1609100113039}\n{"example2": [12321,546456,45687,1]}'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Raúl&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2026 22:55:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262936#M476</guid>
      <dc:creator>rpasca</dc:creator>
      <dc:date>2026-08-26T22:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: XSIAM HTTP Log Collector  Testing</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262968#M477</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I must have done once, because it at least produces a 400 - Bad Request.&lt;/P&gt;
&lt;P&gt;Which is further then I got, but I still do not know why this is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2026 06:28:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1262968#M477</guid>
      <dc:creator>J.Huchtktter</dc:creator>
      <dc:date>2026-08-27T06:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: XSIAM HTTP Log Collector  Testing</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1263007#M478</link>
      <description>&lt;P&gt;A bit of testing has turned out a few more things, and likely the cause of the specific HTTP 400:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While Raúl was correct about the quotes being an issue with Python, the HTTP 400 error seems to arise whenever a HTTP collector instance is changed - e.g. the input type is changed from RAW to JSON, or the compression is changed from Gzip to uncompressed or ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As this has cost me a lot of nerves and testing, here are some of my findings&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set up the HTTP based Collector - set it up in the way you want it to run. If you ever have to change &lt;STRONG&gt;anything&lt;/STRONG&gt; about it, create a new one and redistribute the API key&lt;/LI&gt;
&lt;LI&gt;JSON-collectors do not actually seem to care if the application type is set to &lt;EM&gt;application/json&lt;/EM&gt; or &lt;EM&gt;text/plain&lt;/EM&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Sending uncompressed data to a gzip collector works, too&lt;/LI&gt;
&lt;LI&gt;Multiple JSON log lines must be sent as on json object per line, separated by line breaks&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Working Python example function:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def test_http_collector(api_key: str, collector_url: str) -&amp;gt; requests.Response:
    headers = {"Authorization": api_key, "Content-Type": "application/json"}
    # Note: the logs must be separated by a new line
    msg_1 = '{"msg": "This is my test!", "severity": "High", "id": "EJhn90nsdui2", "duration": 432, "timestamp": 1609100113039}'
    msg_2 = '{"msg": "I am also a test", "severity": "Low", "id": "kdrjhWo834jhz", "duration": 20, "timestamp": 1609100113052}'
    body = f"{msg_1}\n{msg_2}"

    return requests.post(
        url=collector_url,
        headers=headers,
        data=body,
        timeout=600
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Aug 2026 13:13:43 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsiam-discussions/xsiam-http-log-collector-testing/m-p/1263007#M478</guid>
      <dc:creator>J.Huchtktter</dc:creator>
      <dc:date>2026-08-27T13:13:43Z</dc:date>
    </item>
  </channel>
</rss>

