Getting Data In

How to add multiple json events as one array?

yuvarajsap
New Member

I am getting output json like this:

{
    "preview": false,
    "result": {
        "job": "abdghytr",
        "Status": "STARTING",
        "_time": "2018-01-22T10:12:55.000+0000",
        "source": "/opt/CA/WorkloadAutomationAE",
        "host": "testmachine",
        "machine": "testmachine-068",
        "event": "CHANGE_STATUS"
    }
} {
    "preview": false,
    "result": {
        "job": "nscdlu8317_w15-repgii",
        "Status": "SUCCESS",
        "_time": "2018-01-22T10:12:55.000+0000",
        "source": "/opt/CA/WorkloadAutomationAE",
        "host": "testmachine",
        "machine": "testmachine-068",
        "event": "CHANGE_STATUS",
        "exitcodestatus": "0"
    }
} 

But I want the output like below with array.

[{
    "preview": false,
    "result": {
        "job": "abdghytr",
        "Status": "STARTING",
        "_time": "2018-01-22T10:12:55.000+0000",
        "source": "/opt/CA/WorkloadAutomationAE",
        "host": "testmachine",
        "machine": "testmachine-068",
        "event": "CHANGE_STATUS"
    }
}, {
    "preview": false,
    "result": {
        "job": "nscdlu8317_w15-repgii",
        "Status": "SUCCESS",
        "_time": "2018-01-22T10:12:55.000+0000",
        "source": "/opt/CA/WorkloadAutomationAE",
        "host": "testmachine",
        "machine": "testmachine-068",
        "event": "CHANGE_STATUS",
        "exitcodestatus": "0"
    }
} ]

can some one please help.

Tags (2)
0 Karma

p_gurav
Champion

Can you provide some sample raw event before indexing?

0 Karma
Get Updates on the Splunk Community!

Cultivate Your Career Growth with Fresh Splunk Training

Growth doesn’t just happen—it’s nurtured. Like tending a garden, developing your Splunk skills takes the right ...

Introducing a Smarter Way to Discover Apps on Splunkbase

We’re excited to announce the launch of a foundational enhancement to Splunkbase: App Tiering.  Because we’ve ...

How to Send Splunk Observability Alerts to Webex teams in Minutes

As a Developer Evangelist at Splunk, my team and I are constantly tinkering with technology to explore its ...