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

Pipeline Processor does not print rule name or id when throwing an error #10526

Closed
kmerz opened this issue Apr 29, 2021 · 0 comments · Fixed by #10528
Closed

Pipeline Processor does not print rule name or id when throwing an error #10526

kmerz opened this issue Apr 29, 2021 · 0 comments · Fixed by #10528

Comments

@kmerz
Copy link
Member

kmerz commented Apr 29, 2021

What?

The pipeline process needs to print rule name and or id when throwing an exception.

Why?

When an exception is raised in the pipeline processing it is important to know what rule caused the error so an fix can be easier applied.

This was seen by various customers.

Your Environment

  • Graylog Version: 3.3
@kmerz kmerz added the feature label Apr 29, 2021
kmerz added a commit that referenced this issue Apr 29, 2021
## Motivation
Prior to this change, when a execption was thrown in the when block of a
pipeline rule, the user could not know which rule was causing the error.

## Description
This change will add an log.error to clarify which rule caused the
trouble and also adds the message which was processed at the moment.

### Example output:
```
2021-04-29 14:39:44,423 ERROR:
org.graylog.plugins.pipelineprocessor.processors.PipelineInterpreter -
This exception was caused by "failing rule"/608aa0122efce1354f715e6c:
source: acme.org | message: 2021-04-29T12:39:44.422Z DELETE
/posts/45326/edit [204] 104ms { controller: PostsController |
sequence_nr: 19 | ingest_time: 2021-04-29T12:39:44.422Z | resource:
/posts/45326/edit | ticks: 20178941558627 | took_ms: 104 |
ingest_time_minute: 39 | gl2_source_input: 5f4dfb5069be46153b9a9a1c |
ingest_time_second: 44 | ingest_time_month: 4 | ingest_time_day: 29 |
http_method: DELETE | user_id: 54351 | ingest_time_hour: 12 | action:
edit | gl2_source_node: 50ab3e2f-5d84-4515-8c4e-aafb91688820 | _id:
f9a5b370-a8e7-11eb-b917-024281ae9e09 | ingest_time_epoch: 1619699984422
| ingest_time_year: 2021 | timestamp: 2021-04-29T12:39:44.423Z |
http_response_code: 204 }
2021-04-29 14:39:44,423 WARN :
org.graylog2.shared.buffers.processors.ProcessBufferProcessor - Unable
to process message <f9a5b370-a8e7-11eb-b917-024281ae9e09>:
org.graylog.plugins.pipelineprocessor.ast.exceptions.FunctionEvaluationException:
java.lang.IllegalArgumentException: Invalid format:
"2021-04-29T12:39:44.423Z" is malformed at "-04-29T12:39:44.423Z"
```

Fixes #10526
@bernd bernd added the triaged label May 3, 2021
kmerz added a commit that referenced this issue May 6, 2021
## Motivation
Prior to this change, when a execption was thrown in the when block of a
pipeline rule, the user could not know which rule was causing the error.

## Description
This change will add an log.error to clarify which rule caused the
trouble and also adds the message which was processed at the moment.

### Example output:
```
2021-04-29 14:39:44,423 ERROR:
org.graylog.plugins.pipelineprocessor.processors.PipelineInterpreter -
This exception was caused by "failing rule"/608aa0122efce1354f715e6c:
source: acme.org | message: 2021-04-29T12:39:44.422Z DELETE
/posts/45326/edit [204] 104ms { controller: PostsController |
sequence_nr: 19 | ingest_time: 2021-04-29T12:39:44.422Z | resource:
/posts/45326/edit | ticks: 20178941558627 | took_ms: 104 |
ingest_time_minute: 39 | gl2_source_input: 5f4dfb5069be46153b9a9a1c |
ingest_time_second: 44 | ingest_time_month: 4 | ingest_time_day: 29 |
http_method: DELETE | user_id: 54351 | ingest_time_hour: 12 | action:
edit | gl2_source_node: 50ab3e2f-5d84-4515-8c4e-aafb91688820 | _id:
f9a5b370-a8e7-11eb-b917-024281ae9e09 | ingest_time_epoch: 1619699984422
| ingest_time_year: 2021 | timestamp: 2021-04-29T12:39:44.423Z |
http_response_code: 204 }
2021-04-29 14:39:44,423 WARN :
org.graylog2.shared.buffers.processors.ProcessBufferProcessor - Unable
to process message <f9a5b370-a8e7-11eb-b917-024281ae9e09>:
org.graylog.plugins.pipelineprocessor.ast.exceptions.FunctionEvaluationException:
java.lang.IllegalArgumentException: Invalid format:
"2021-04-29T12:39:44.423Z" is malformed at "-04-29T12:39:44.423Z"
```

Fixes #10526
bernd added a commit that referenced this issue May 6, 2021
Prior to this change, when a exception was thrown in the when block of a
pipeline rule, the user could not know which rule was causing the error.

This change will add an log.error to clarify which rule caused the
trouble and also adds the message which was processed at the moment.

Fixes #10526

* Also log a warning for errors that happen in the action block of a rule

Change log statements to WARN to make it easier to disable them by
configuring the logger to ERROR for this class.

* Fix SimulationResults if the backend raises an exception

Co-authored-by: Bernd Ahlers <bernd@graylog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants