graylog-plugin-pipeline-processor icon indicating copy to clipboard operation
graylog-plugin-pipeline-processor copied to clipboard

Create Rule with REST API does not work correctly

Open gianluca-valentini opened this issue 7 years ago • 2 comments

Problem description

Is impossible to create a Rule using REST test on Graylog UI api-browser (POST on /plugins/org.graylog.plugins.pipelineprocessor/system/pipelines/rule)

Steps to reproduce the problem

  1. Go to Graylog api-browser and open Plugins/Pipelines/Rules : Rules for the pipeline message processor (POST /plugins/org.graylog.plugins.pipelineprocessor/system/pipelines/rule)
  2. Try to insert a Rule like this:
{
    "title": "test_has_field",
    "description": "",
    "source": "rule \"test_has_field\"\r\n\r\nwhen \r\n   true\r\n    \r\nthen\r\n  \r\n  end\r\n",
    "errors": null
  }
  1. Result:
{
  "type": "ApiError",
  "message": "Can not construct instance of org.graylog.plugins.pipelineprocessor.rest.RuleSource, problem: Should never call 'set' on setterless property\n at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@18a041d3; line: 7, column: 3]"
}

image

Environment

Graylog Version: v2.2.3+7adc951 Pipeline Processor plugin version:2.2.3 Elasticsearch Version: docker image: 'elasticsearch:2' MongoDB Version: docker image: 'mongo:3' Operating System: Docker host: ubuntu Browser version: Chrome 59.0.3071.115

gianluca-valentini avatar Jul 27 '17 20:07 gianluca-valentini

There is a news. I discovered that the problem is the errors field. In fact, removing it the ReST API works fine.

gianluca-valentini avatar Jul 28 '17 10:07 gianluca-valentini

@gianluca-valentini Yes, errors is supposed to be a read-only field and not part of the payload.

This being said, Graylog shouldn't throw an error if the errors field is set.

joschi avatar Jul 28 '17 10:07 joschi