Graylog2 / Graylog2/graylog2-server

Error on Grok pattern list import with double pattern names in file

Open
#5,551 1 comment 0 reactions 0 assignees View on GitHub
#S bug improvement triaged
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:
![bildschirmfoto 2019-01-17 um 17 32 27](https://user-images.githubusercontent.com/46342762/51333433-f7139280-1a7d-11e9-9c3b-e1307a2ea3a9.png)

```
{
"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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.