Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Location of JSON file to insert custom event


#1

Hi,

I am trying to push the data from SQL DB to Insights. So I have created a JSON file with SQL DB data. To insert the API key where should I save my JSON file (example_events.json) from below curl command.

cat example_events.json | curl -d @- -X POST -H "Content-Type: application/json" -H "X-Insert-Key: ******-W8nG-h9" https://insights-collector.newrelic.com/v1/accounts/XXX/events

Appreciate your help

Thanks
Lakshmi


#2

The JSON file will need to be saved in a location that the cat command can find. Typically this will be the same directory that you run the command from. You can also pass an absolute path to cat such as cat /home/user/example_event.json.


#3

Thank you. This is the first time I am working with events. Now I understood. I thought I need to execute where the agent installed. But it has nothing to do with agent as it has API key.


#4

Hi,

Related to this query, I was trying to execute this query in windows environment and thought of sharing this. Please ignore if you already aware of this.

The Cat command "
cat example_events.json | curl -d @- -X POST -H “Content-Type: application/json” -H “X-Insert-Key: XXX” https://insights-collector.newrelic.com/v1/accounts/XXX/events"

To execute in Windows the below command will work with Curl executable:
curl -d @- -X POST -H “Content-Type: application/json” -H “X-Insert-Key: XXX” https://insights-collector.newrelic.com/v1/accounts/XXX/events < example_events.json

Thanks
Lakshmi


#5

Thank you for sharing, @LakshmiKaravad! Super helpful!


#6

@LakshmiKaravad Thanks for the very helpful information… I could successfully execute the command on windows. But, how can I validate that on my New Relic dashboard? I could not view that data there. Do I need to run any query or do I need to create a dashboard first or what is the exact procedure in order to view the data on new relic. Kindly help.