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

Add option to only use named captures in Grok extractor #2500

Merged
merged 3 commits into from Jul 19, 2016

Conversation

Projects
None yet
2 participants
@bernd
Member

bernd commented Jul 19, 2016

Update to the latest version of our java-grok port which adds support for this via upstream.

The option is disabled by default.

Fixes #1486

Example screenshots:

screenshot from 2016-07-19 16 12 54
screenshot from 2016-07-19 16 12 36

Add option to only use named captures in Grok extractor
Update to the latest version of our java-grok port which adds support
for this via upstream.

The option is disabled by default.

Fixes #1486
pom.xml Outdated
</dependency>
<dependency>
<groupId>com.github.tony19</groupId>
<artifactId>named-regexp</artifactId>

This comment has been minimized.

@joschi

joschi Jul 19, 2016

Contributor

What is this dependency used for? It's also already a transitive dependency of org.graylog2.repackaged:grok:0.1.6-graylog.

This comment has been minimized.

@bernd

bernd Jul 19, 2016

Member

The grok extractor test didn't run at one point without this. But I guess that was some local issue. Works now.

pom.xml Outdated
<groupId>com.github.tony19</groupId>
<artifactId>named-regexp</artifactId>
<version>0.2.3</version>
<scope>compile</scope>

This comment has been minimized.

@joschi

joschi Jul 19, 2016

Contributor

compile is the default scope for dependencies.

@@ -68,13 +70,15 @@ public GrokExtractor(MetricRegistry metricRegistry,
throw new ConfigurationException("grok_pattern not set");
}

final boolean namedCapturesOnly = firstNonNull((Boolean) extractorConfig.get("named_captures_only"), false);

This comment has been minimized.

@joschi

joschi Jul 19, 2016

Contributor

Aesthetic nitpick but not necessary to change:

final boolean namedCapturesOnly = (boolean) extractorConfig.getOrDefault("named_captures_only", false);

@joschi joschi self-assigned this Jul 19, 2016

@joschi joschi added the improvement label Jul 19, 2016

@joschi

This comment has been minimized.

Contributor

joschi commented Jul 19, 2016

LGTM. 👍

@joschi joschi merged commit 13f42b3 into master Jul 19, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1119 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 605 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@joschi joschi deleted the issue-1486 branch Jul 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment