Accidentaly altered "all message stream"

Hello,

I “broke” my instance of graylog, by mistakenly changing the stream “all message”.

Here’s what I did:
I wanted to change the “stream” of my widgets on a dashboard. So I exported the dashboard perform a search / replace on the “stream_id” by setting the stream number by default.

But when i import back the modified json, my default stream get a new name and rules that applies to it.

So I would like to edit directly in base on mongo (graylog forbids me to do it) the name of the stream and removed the rules that apply to it.

Someone could help me, I am not at all familiar with mongo.

I also recovered from a very old backup how the document should be in mongodb streams collections {"_id":{"$oid":"000000000000000000000001"},"creator_user_id":"local:admin","is_default_stream":true,"index_set_id":"5a05b8abc44a092d669d31d5","matching_type":"AND","remove_matches_from_default_stream":false,"description":"Stream containing all messages","created_at":{"$date":"2017-11-10T14:33:15.112Z"},"disabled":false,"title":"All messages"}

Here the corrupted one :
{ “_id” : ObjectId(“000000000000000000000001”), “creator_user_id” : “xxx”, “is_default_stream” : false, “index_set_id” : “5a05b8abc44a092d669d31d5”, “matching_type” : “AND”, “description” : “Ldap”, “created_at” : ISODate(“2019-01-31T08:23:37.888Z”), “disabled” : false, “title” : “slapd”, “content_pack” : “5c52b0712c2638273bb30581” }

Thank you.

I answer myself so i finally manage to repaid all thing by doing this :
  1. delete bad stream rules :
    db.streamrules.remove( { “_id” : ObjectId(“5c52b0892c2638273bb3059d”) } )

  2. update existing default streams :
    db.streams.update(
    {"_id" : ObjectId(“000000000000000000000001”)},
    {“creator_user_id”:“local:admin”,
    “is_default_stream”:true,
    “index_set_id”:“5a05b8abc44a092d669d31d5”,
    “matching_type”:“AND”,
    “remove_matches_from_default_stream”:false,
    “description”:“Stream containing all messages”,
    “created_at”:ISODate(“2017-11-10T14:33:15.112Z”),
    “disabled”:false,
    “title”:“All messages”}
    )

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.