Logging in Serverless Spark (Part3)

Overview

LogDNA Service Key & Export API

Execute the Export API for your application

curl -s "https://api.us-south.logging.cloud.ibm.com/v2/export?query=$application_id&to=$(date +%s)000&from=$(($(date +%s)-86400))000" -u $service_key: > logs.json

Extract Application Log Lines

cat logs.json | jq '.lines | .[] | .message' > $application_id.log

Debug with grep

That’s it!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store