Graylog2 / Graylog2/graylog2-server

API: Updating rules via streams api has no effect

Open
#8,607 0 comments 0 reactions 0 assignees View on GitHub
to-verify
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

Creating streams including rules works. An update of the streams also works. An update of the rules in the streams does not work.

## Expected Behavior
PUT on /streams/{streamId} should update stream rules.

## Current Behavior
Model (from api docs):
```
urn:jsonschema:org:graylog2:rest:resources:streams:responses:StreamResponse {
id (string, optional),
creator_user_id (string, optional),
outputs (array[object], optional),
matching_type (string, optional),
description (string, optional),
created_at (string, optional),
disabled (boolean, optional),
rules (array[object], optional),
alert_conditions (array[object], optional),
alert_receivers (object, optional),
title (string, optional),
content_pack (string, optional),
is_default (boolean, optional),
remove_matches_from_default_stream (boolean, optional),
index_set_id (string, optional)
}
```

JSON body:
```
{
"id": "***",
"creator_user_id": "***",
"outputs": [],
"matching_type": "AND",
"description": "***",
"created_at": "2020-07-23T08:02:50.822Z",
"disabled": false,
"rules": [
{
"field": "source",
"stream_id": "***",
"description": null,
"id": "***",
"type": 2,
"inverted": false,
"value": "***"
}
],
"alert_conditions": [],
"alert_receivers": {
"emails": [],
"users": []
},
"title": "***",
"content_pack": null,
"remove_matches_from_default_stream": true,
"index_set_id": "***",
"is_default": false
}
```

All changes in rules are not executed. The higher-level ones will be executed.

Response code: 200

Response headers:
```
{"Access-Control-Allow-Credentials":"true","Access-Control-Allow-Headers":"Authorization, Content-Type, X-Graylog-No-Session-Extension, X-Requested-With, X-Requested-By","Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Origin":"https://***","Access-Control-Max-Age":"600","Content-Encoding":"gzip","Content-Type":"application/json","Date":"Thu, 23 Jul 2020 09:26:03 GMT","Server":"***","Vary":"Accept-Encoding","X-Firefox-Spdy":"h2","X-Graylog-Node-Id":"***","X-Runtime-Microseconds":"60936"}
```

## Steps to Reproduce (for bugs)

1. Create an stream with rules
2. Update the stream rules

## Your Environment

* Graylog Version: 3.3.2+ade4779
* Elasticsearch Version: 6.3.0
* MongoDB Version: 4.2.1
* Operating System: Debian 10 64
* Browser version: N/A

Thank you very much, if you need further information, I can give it to you later.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.