Graylog2 / Graylog2/graylog2-server
Error on Grok pattern list import with double pattern names in file
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
If I import a Grok pattern list that contains double pattern names, the upload stops at the double name. The checkbox "Replace all existing patterns" was marked before uploading.
## Expected Behavior
An error message that indicates the double pattern name problem.
## Current Behavior
After clicking the upload button, this error message occurs:

```
{
"type": "ApiError",
"message": "Write failed with error code 11000 and error message 'insertDocument :: caused by :: 11000 E11000 duplicate key error index: graylog.grok_patterns.$idx_name_asc_unique dup key: { : \"QS\" }'"
}
```
## Steps to Reproduce
1. Upload this Grok pattern list with a double pattern name in it:
[Grok-pattern-list.txt](https://github.com/Graylog2/graylog2-server/files/2772157/Grok-pattern-list.txt)
(modified from here: https://github.com/elastic/logstash/blob/v1.4.2/patterns/grok-patterns )
## Your Environment
* Graylog Version: Graylog 3.0.0-beta.4 on internal dev environment
* Operating System: Mac OS Mojave 10.14.2
* Browser version: Safari Version 12.0.2 (14606.3.4)
Contributor guide
Assessment
This issue has not been assessed yet.