In my conf file I have a
[[inputs.file]]
files = ["json.json"]
data_format = "value"
data_type = "string"
which I am then able to pass to
[[processors.starlark]]
source = '''
load("json.star", "json")
def apply(metric):
metrics = []
json_data = json.decode(metric.fields.get("value"))
.... process complex json data ....
And this works without issue.
I’d like to start pulling my json data from an API endpoint. (values in are scrubbed data for security reasons)
[[inputs.http]]
urls = [
"https://api.clover.com/v3/merchants/[merchantid]/orders?expand=lineItems&limit=5"
]
method = "GET"
[inputs.http.headers]
Authorization = "Bearer [my-auth-token]"
data_format = "value"
data_type = "string"
But the inputs.http complains about not being able to parse the json. I don’t want it to try and parse the json, I just want it to pass the entire response body on to starlark for processing.
Note: I am able to call the API using curl without issues and get back the expected json response. So the endpoint is working correctly.
Any ideas?