Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.33k stars 1.06k forks source link

Manually add content pack #3838

Closed mf-bmihaescu closed 7 years ago

mf-bmihaescu commented 7 years ago

Hi, I try to import a content pack using a shell script and i'm not able to add a custom id to it. I also need a way to get the one that is provided automatically.

GRAYLOG_CONTENT='
{"id":"myid","name":"Content_test","description":"created for testing ","category":"mongodb","inputs":[],"streams":[],"outputs":[],"dashboards":[{"title":"MongoDB overview","description":"Overview of MongoDB activity","dashboard_widgets":[{"description":"Activity last 24h","type":"SEARCH_RESULT_CHART","cache_time":10,"configuration":{"interval":"hour","timerange":{"type":"relative","range":86400},"query":"source:mongoprof AND database:content"},"col":1,"row":2,"height":1,"width":1},{"description":"Activity 24h core+analitycs","type":"SEARCH_RESULT_CHART","cache_time":10,"configuration":{"interval":"hour","timerange":{"type":"relative","range":86400},"query":"source:mongoprof AND database:momentfeed"},"col":1,"row":1,"height":1,"width":1},{"description":"Search result count","type":"SEARCH_RESULT_COUNT","cache_time":10,"configuration":{"timerange":{"type":"relative","range":86400},"lower_is_better":false,"trend":true,"query":"source:mongoprof"},"col":0,"row":0,"height":0,"width":0},{"description":"Quick values","type":"QUICKVALUES","cache_time":10,"configuration":{"timerange":{"type":"relative","range":86400},"field":"database","show_pie_chart":true,"query":"source:mongoprof","show_data_table":true},"col":0,"row":0,"height":0,"width":0}]}],"grok_patterns":[]}'

ERROR: {"type":"ApiError","message":"Error mapping BSON to POJOs"}
joschi commented 7 years ago

We are using GitHub issues for tracking bugs in Graylog itself, but this doesn't look like one. Please post this issue to our discussion forum or join the #graylog channel on freenode IRC.

Thank you!

joschi commented 7 years ago

@mf-bmihaescu You also might want to take a look at the Content Pack autoloader: https://github.com/Graylog2/graylog2-server/blob/2.2.3/misc/graylog.conf#L540-L549