Getting Data In

Why do I get json parsing errors?

ddrillic
Ultra Champion

I'm trying to add a data source which contains json data. The data is -

{"markers": [
        {
            "point":new GLatLng(40.266044,-74.718479), 
            "homeTeam":"Lawrence Library",
            "awayTeam":"LUGip",
            "markerImage":"images/red.png",
            "information": "Linux users group meets second Wednesday of each month.",
            "fixture":"Wednesday 7pm",
            "capacity":"",
            "previousScore":""
        },
        {
            "point":new GLatLng(40.211600,-74.695702),
            "homeTeam":"Hamilton Library",
            "awayTeam":"LUGip HW SIG",
            "markerImage":"images/white.png",
            "information": "Linux users can meet the first Tuesday of the month to work out harward and configuration issues.",
            "fixture":"Tuesday 7pm",
            "capacity":"",
            "tv":""
        },
        {
            "point":new GLatLng(40.294535,-74.682012),
            "homeTeam":"Applebees",
            "awayTeam":"After LUPip Mtg Spot",
            "markerImage":"images/newcastle.png",
            "information": "Some of us go there after the main LUGip meeting, drink brews, and talk.",
            "fixture":"Wednesday whenever",
            "capacity":"2 to 4 pints",
            "tv":""
        },
] }

I get the following errors -

04-14-2017 10:17:22.960 -0500 ERROR JsonLineBreaker - JSON StreamId:0 had parsing error:Unexpected character while parsing l
iteral token: 'e' - data_source="/tmp/data3.json", data_host="<host>", data_sourcetype="_json"
04-14-2017 10:17:22.960 -0500 ERROR JsonLineBreaker - JSON StreamId:0 had parsing error:Unexpected character: ':' - data_sou
rce="/tmp/data3.json", data_host="<host>", data_sourcetype="_json"

What can it be?

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

The value of attribute point should be in double quotes e.g. new GLatLng(40.266044,-74.718479). You can verify the format's correctness by online tools like http://pro.jsonlint.com/ . Changing "point":new GLatLng(40.266044,-74.718479),with "point":"new GLatLng(40.266044,-74.718479)", will resolve the issue.

View solution in original post

somesoni2
Revered Legend

The value of attribute point should be in double quotes e.g. new GLatLng(40.266044,-74.718479). You can verify the format's correctness by online tools like http://pro.jsonlint.com/ . Changing "point":new GLatLng(40.266044,-74.718479),with "point":"new GLatLng(40.266044,-74.718479)", will resolve the issue.

ddrillic
Ultra Champion

Right!!! funny, it's an example from Example Google Maps JSON File

Let me check it ; -)

0 Karma

ddrillic
Ultra Champion

Perfect - can you please convert to an answer?

0 Karma
Get Updates on the Splunk Community!

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...