Hi,
Sorry for long post . I’m trying to figure out how to send all points and metrics as event-strings (one event-string for each point and metric) to Splunk. I was thinking about doing the following:
- k6 run MyLoadtest.js --out json=‘LoadTestResult.json’
- In a JavaScript to be executed one time by k6 (to make use of the k6 built in http-functionality to post event-string to Splunk) doing the following:
let resFileJson = JSON.parse(open(‘LoadTestResult.json’)); - In loops Traverse the resFileJson object point by point, metric by metric and for each one of them create and post to Splunk collector a “Splunk event string”. A string containing only the point and metric data that I need for further processing in Splunk.
But to my dismay the “json”-output from k6 is really not proper json-format (parser gives error) but something else, even if the k6 command says json. So now I don’t know how to solve this problem getting the points and metrics to Splunk in a way not requiring me to go all “code crazy” (I’m only a “hobby coder”) doing super advanced plugins to k6 etc.
-
First I wonder if you know if a fix is coming soon for the incorrect json formatting? I read some in the git comments etc about this not being considered a bug (even if the command output says json) but that a flag for it might be implemented to switch the output to proper json. Unfortunately I beg to differ that the issue is not a bug and hope there will be possible to use this switch sometime soon.
-
If the bug won’t be fixed anytime soon I’d be very grateful for any alternate solution or suggestions on how to get the k6 data to Splunk in a somewhat convenient way.
I tried the Influx-Grafana way but it doesn’t give me enough design possibilities for dashboards (aggregate on transaction/group level, choosing a specific execution not having to set time period, comparing two executions side by side etc). Plus we don’t want to use one more technique in the company for this purpose (App Dynamics and Splunk should be enough, hehe).
Thank you very much for any feedback and help with this.
Have a great day
/Fredrik