-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Ingest Pipelines] Invalid error shown for grok processor #124027
Comments
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
The original thinking was that users are expected to edit a stringified string, they will be able to work with whitespace chars more easily in the context of the dissect processor. It looks like this same assumption does not need to hold for the grok processor. I think we can get the behavior we want with the following changes: diff --git i/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx w/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx
index ae2d341c58c..7ff779e1398 100644
--- i/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx
+++ w/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx
@@ -49,7 +49,6 @@ const patternsValidation: ValidationFunc<any, string, ArrayItem[]> = ({ value, f
const patternValidations: Array<ValidationFunc<any, string, string>> = [
emptyField(valueRequiredMessage),
- isJSONStringValidator,
];
const fieldsConfig: FieldsConfig = {
@@ -58,8 +57,7 @@ const fieldsConfig: FieldsConfig = {
label: i18n.translate('xpack.ingestPipelines.pipelineEditor.grokForm.patternsFieldLabel', {
defaultMessage: 'Patterns',
}),
- deserializer: flow(String, to.escapeBackslashes),
- serializer: from.unescapeBackslashes,
+ deserializer: String,
helpText: i18n.translate('xpack.ingestPipelines.pipelineEditor.grokForm.patternsHelpText', {
defaultMessage:
'Grok expressions used to match and extract named capture groups. Uses the first matching expression.', This should give us how the grokdebugger behaves. [EDIT] |
Hi All, I'm using this grok code and works: |
Hi All, (?:-|PhoneCall: %{BASE16NUM:id}) - (?:-|%{WORD:answer.status}). BadRequest from Beeline: (?:-|%{WORD:error}) - (?:-|%{DATA:message}): (?< trash >[(])(?:-|%{INT:answer.code})(?< trash >[)]) (?:-|%{GREEDYDATA:answer.text}). |
Any movement on this? This still exists in 7.17.3. After testing in the Grok Parser in Dev Tools my grok pattern works, but in the ingest pipeline it breaks with this error. |
Up |
@bzarbalthazar Could you please share the pattern you're using that's not working? @GexogenSG1 Could you also please share a pattern that's being rejected by the Ingest Pipelines UI? |
A glass of vine to this sir! Until this issue gets resolved, please use workarounds as advised above:
|
Hello it's behaving the same in Agent Policy, processor block too (Nginx 1.7.0) or it is not related ? |
Kibana version:
7.16.3
Describe the bug:
User is shown the error "Invalid JSON string" after entering a valid grok pattern in the Ingest Pipelines UI. This bug appears to have been introduced via #94689.
Steps to reproduce:
\
character in the following part of the expression:\[%{HTTPDATE:timestamp}\]
.Screenshots:
The text was updated successfully, but these errors were encountered: