Closed mariussturm closed 8 years ago
What if graylog2 allowed you to define the stream_id when you created the stream? Then you could just hardcode a stream_id in your recipe when you create it. This would also be helpful for making sure that the url that users may have bookmarked will not change even if the system is rebuilt. The same would have to go for the dashboard uuid as well, for the purposes of making it easy to re-create something with the same url even if you rebuild the whole system.
Good idea but unfortunately the Graylog API needs to generate the ID.
Why does Graylog need to generate the ID? Could it not be optional? Graylog could generate it if one is not provided.
This is simply how the API works. Sorry but I can't rewrite big parts of the server just to make this cookbook work.
I don't think this is difficult. You just pass a string to the ObjectId function when you want to pick the id yourself instead of letting Mongo generate one for you. See: http://api.mongodb.org/java/2.12/org/bson/types/ObjectId.html#ObjectId(java.lang.String)
This is not only useful for the cookbook. This would also help make sure that the URLs used to access the streams and dashboard do not change, even if you rebuild the system.
@jgarland79 forgetting about conceptual issues, letting people give their own IDs will create another bunch of problems we would have to take care of, like having to deal with weird characters, duplicated IDs, possible security repercussions, and some others. To be honest, I don't think this is important enough to justify the time and effort that making and testing the change would require.
Closed in favor of content-pack auto loading.
The cookbook should be able to create a dashboard like this:
{ "title" : "Stream Dashboard", "description" : "Stream related Dashboard", "creator_user_id" : "admin", "widgets" : [ { "description" : "All Logs (5m)", "config" : { "interval" : "minute", "query" : "*", "timerange" : { "range" : 300, "type" : "relative" }, "stream_id" : "54ebad87e4b010108e5347ad" }, "type" : "search_result_chart", "creator_user_id" : "admin" } ] }
The important value is the
stream_id
. We need to create the stream in one resource or reach in a value for it.