Open sprichar opened 6 years ago
This might be a docs error in the header name. In the code it looks like it might be looking for the "Accept" header. try setting that to application/json
acceptedContentType := r.Header.Get("Accept")
var contentType string
switch acceptedContentType {
case "application/json":
contentType = acceptedContentType
default:
contentType = "application/logfmt"
}
thanks
when executing GET /kapacitor/v1preview/logs Content-Type: application/json
I always get logfmt format back...
root@devdatacenter-kapacitor-0:/# curl --header "Content-Type: application/json" localhost:9092/kapacitor/v1preview/logs ts=2018-08-08T20:48:19.626Z lvl=info msg="created log session" service=sessions id=cd1e7a68-a6d0-4a5f-9a0d-d7842e2ecca0 content-type=application/logfmt ...
2018/08/08 19:57:47 Using configuration at: /etc/kapacitor/kapacitor.conf ts=2018-08-08T19:57:47.978Z lvl=info msg="kapacitor starting" service=run version=1.5.0 branch=HEAD commit=ee0d8bc17a01a3321d7d44eb5ee8e1156c3d5ec6 ts=2018-08-08T19:57:47.978Z lvl=info msg="go version" service=run version=go1.10.2