<?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 Why is JSON from scripted input raw events in random orders? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459804#M79396</link>
    <description>&lt;P&gt;have no idea what is going on here.  I can make the same api call that the script is and receive the json back in the same order every time.  Splunk for some reason has the response payload elements in random orders. &lt;/P&gt;

&lt;P&gt;Anyone have any ideas?&lt;/P&gt;

&lt;P&gt;Here are some examples of the first part of the raw payload as displayed in Splunk form the same input (running every 3 minutes)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"more": true, "incidents": [{"last_status_change_by": {"summary":

{"total": null, "more": true, "limit": 2, "incidents": [{"incident_key":

{"offset": 0, "total": null, "incidents": [{"incident_number":
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The preferred way I would like to see this is as below, which is also what is constantly output from running the script directly&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"incidents":[{"incident_number":164831,"title":"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Jul 2018 17:06:18 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2018-07-25T17:06:18Z</dc:date>
    <item>
      <title>Why is JSON from scripted input raw events in random orders?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459804#M79396</link>
      <description>&lt;P&gt;have no idea what is going on here.  I can make the same api call that the script is and receive the json back in the same order every time.  Splunk for some reason has the response payload elements in random orders. &lt;/P&gt;

&lt;P&gt;Anyone have any ideas?&lt;/P&gt;

&lt;P&gt;Here are some examples of the first part of the raw payload as displayed in Splunk form the same input (running every 3 minutes)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"more": true, "incidents": [{"last_status_change_by": {"summary":

{"total": null, "more": true, "limit": 2, "incidents": [{"incident_key":

{"offset": 0, "total": null, "incidents": [{"incident_number":
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The preferred way I would like to see this is as below, which is also what is constantly output from running the script directly&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"incidents":[{"incident_number":164831,"title":"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jul 2018 17:06:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459804#M79396</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2018-07-25T17:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is JSON from scripted input raw events in random orders?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459805#M79397</link>
      <description>&lt;P&gt;I should add, that although json is a random order payload, the script itself somehow always returned the same order when run via pycharm, etc.  The reason I care is I need to set line_breakers to extract each incident into its own event.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 17:12:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459805#M79397</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2018-07-25T17:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why is JSON from scripted input raw events in random orders?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459806#M79398</link>
      <description>&lt;P&gt;Not something I've seen before. Theoretically JSON/py dict key order is irrelevant (although I think arrays are meant to be returned in element order) and there is nothing broken in returning the data out of order, but I agree it it nice when it comes back the same way every time. &lt;/P&gt;

&lt;P&gt;That said other than the look of it, this shouldn't be causing an issue - is it breaking your search in some way?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 12:42:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459806#M79398</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2018-07-26T12:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why is JSON from scripted input raw events in random orders?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459807#M79399</link>
      <description>&lt;P&gt;It was only an issue as I needed to break the json into individual elements, so setting a line_breaker or break before wouldn't work without knowing how the events are coming in, that said, the solution was easier than I though just pass a sort_keys argument&lt;/P&gt;

&lt;P&gt;print(json.dumps(json_data, sort_keys=True))&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-JSON-from-scripted-input-raw-events-in-random-orders/m-p/459807#M79399</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2020-09-29T20:36:47Z</dc:date>
    </item>
  </channel>
</rss>

