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

Added pattern name check to Grok.compile() #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bekce
Copy link

@bekce bekce commented Mar 30, 2015

Grok.compile() silently ignored non-existent pattern names and simply placed "null". I have changed it to throw an exception if no pattern was found with given name.

@@ -359,6 +359,9 @@ public void compile(String pattern) throws GrokException {
// Log the exeception
}
}
if(!grokPatternDefinition.containsKey(group.get("pattern"))){
Copy link
Contributor

Choose a reason for hiding this comment

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

@bekce Add space after if and parenthesis.

if (!grokPatternDefinition.containsKey(group.get("pattern"))) {

@@ -359,6 +359,9 @@ public void compile(String pattern) throws GrokException {
// Log the exeception
}
}
if(!grokPatternDefinition.containsKey(group.get("pattern"))){
throw new GrokException("Pattern name " + group.get("pattern") + " unknown!");
Copy link
Contributor

Choose a reason for hiding this comment

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

Alter the indentation to consistent with the existing code.

@SivaAccionLabs
Copy link
Contributor

@bekce Please resolve the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants