Hi,
I’m using v2.2.3 and I want to create Stream using ReST API (using demo on api/api-browser GraylogURL).
Currently I have a problem with it about the optional attribute index_set_id.
Looking the Streams : Manage streams, I’m using the POST service with this json
With this code I have a 400 error code with this details:
{
“type”: “ApiError”,
“message”: “Can not construct instance of org.graylog2.rest.resources.streams.requests.CreateStreamRequest, problem: Null indexSetId\n at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@32d92490; line: 17, column: 1]”
}
I have the same result if I use index_set_id with null or embpy value string (“”).
So it seems that index_set_id is mandatory also because if I set it (coping it from all messages Stream), the POST works fine, and the Stream is created.
Can somebody help me to understand this situation? where I’m wrong?
Thanks
Gianluca
Interesting, the documentation browser (Swagger UI) seems to have a problem with the “optional” attribute.
As you can see in CreateStreamRequest, many of the attributes are in fact not optional.
You can get a list of index sets from the /system/indices/index_sets resource of the Graylog REST API.