Graylog2 / graylog-plugin-pipeline-processor

[DEPRECATED] Graylog Pipeline Message Processor Plugins
https://www.graylog.org/
GNU General Public License v3.0
21 stars 15 forks source link

Create Rule with REST API does not work correctly #201

Open gianluca-valentini opened 7 years ago

gianluca-valentini commented 7 years ago

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
    }
  3. 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 commented 7 years ago

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

joschi commented 7 years ago

@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.