Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Pipeline Processor plugin into Graylog core #4590

Merged
merged 541 commits into from
Feb 16, 2018
Merged

Conversation

joschi
Copy link
Contributor

@joschi joschi commented Feb 15, 2018

Edmundo Alvarez and others added 30 commits July 20, 2016 12:28
We should call `InterpreterListener.finishProcessing()` only once, but
before that was not necessarily true, as it was being called inside a
loop.

Instead, now we call it in the same method as `startProcessing()`, after
all processing has been finished.

Fixes #51
* Providing a message decorator that uses pipelines.
* Making decorator configurable.
* Allow adding new messages by pipeline decorator.
* Adding changes related due to introduced listener.
* Adapt to naming changes, using easier forEach idiom.
* Changing decorator to work on SearchResponse instead of message list.
Since #32, the behaviour of `to_ip()` changed and now it doesn't raise
an exception in those circumstances. Now we use `regex()` to throw an
exception instead.
* Providing a message decorator that uses pipelines.
* Making decorator configurable.
* Allow adding new messages by pipeline decorator.
* Adding changes related due to introduced listener.
* Adapt to naming changes, using easier forEach idiom.
* Changing decorator to work on SearchResponse instead of message list.
* Adding decoration stats for pipeline processor decorator.
* Add uppercase decorator using pipelines interpreter with preset.
* Decorators don't need to generate decoration stats on their own anymore.
Disable building the web-part of this project because it would require a
full checkout of the Graylog web interface.
* Use core Routes instead of literals
  This allows us to prefix routes if needed.
* Make plugin aware of __webpack_public_path__ setting

Refs #2564
The server cache is necessary because the named captures support needs a separately compiled regex.
So far the cache is only used by the grok function in the pipeline processor

Closes #59
* there was a bug with to_string returning null instead of its default value (refs #63)
* all core conversion functions now return their "default empty" value if the value is `null`
  - String: ""
  - bool: false
  - double: 0d
  - long 0L
  - IP: V4 ANY (0.0.0.0)
 * adds test cases for all cases, including the edge cases
`evalError()` can no longer trigger the error tested for and was removed.
`evalErrorSuppressed()` now tests an illegal default value in `to_ip()`.

Fixes #64
This change should not affect `javac` at all, but intellij flags the collect call with having two errors.
joschi and others added 17 commits January 18, 2018 13:38
Replace `org.jboss.netty.handler.ipfilter.CIDR` with `org.graylog2.utilities.IpSubnet`
to get rid of the Netty 3 dependency in the `cidr_match()` function.

Refs #4226
The message timestamp used to be in the system default locale instead of UTC.

Additionally, this commit adds tests/examples for accessing individual components of the message timestamp in a pipeline rule.
* Add comparison functions for all supported types

* Ensure actions were triggered in FunctionsSnippetsTest#comparisons()
Add "parse_unix_milliseconds" functions
* Add support for JsonNode to ´set_fields()`

Sometimes users might want to parse and merge the JSON payload of a message
with the Graylog message without knowing the complete structure of the payload
or without having a fixed structure which could be selectively merged by using
the `json_path()` method.

This commit essentially adds the possiblity to create a pipeline rule emulating
the existing JSON extractor:

    rule "json"
    when
      // some condition
    then
      let json = parse_json(to_string($message.some_field));
      set_fields(json);
    end

* Introduce `to_map` function to convert JsonNode to Map

* Fix description of `to_map()` function
...and less Forbidden APIs warnings
Otherwise the named "cached_stageiterators" and "generate_native_code" settings cannot be found.

While this *should* work with the `PluginModule` interface and the `PluginModule#getConfigBeans()`
method, fixing this would require some refactorings which I'd like to defer to a later point in time
@joschi joschi added this to the 3.0.0 milestone Feb 15, 2018
@kroepke kroepke self-requested a review February 16, 2018 10:27
Copy link
Member

@kroepke kroepke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works on my machine

@kroepke kroepke merged commit b992b5c into master Feb 16, 2018
@kroepke kroepke deleted the pipeline-issue-216 branch February 16, 2018 11:30
kroepke added a commit that referenced this pull request Feb 16, 2018
@kroepke kroepke restored the pipeline-issue-216 branch February 16, 2018 11:37
joschi pushed a commit that referenced this pull request Feb 16, 2018
@joschi joschi deleted the pipeline-issue-216 branch February 16, 2018 12:16
joschi pushed a commit to Graylog2/graylog-plugin-cef that referenced this pull request Feb 16, 2018
In order to be able to build the old Graylog project manifest,
this commit temporarily removes the graylog-plugin-pipeline-processor dependency.

Refs Graylog2/graylog2-server#4590
Refs Graylog2/graylog2-server#4592
Refs Graylog2/graylog-project-internal#5
joschi pushed a commit to Graylog2/graylog-plugin-threatintel that referenced this pull request Feb 16, 2018
In order to be able to build the old Graylog project manifest,
this commit temporarily removes the graylog-plugin-pipeline-processor dependency.

Refs Graylog2/graylog2-server#4590
Refs Graylog2/graylog2-server#4592
Refs Graylog2/graylog-project-internal#8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants