ElasticSearch提取节点grok解析问题

时间:2016-12-05 20:44:37

标签: regex elasticsearch grok

我试图在两个括号之间提取文本。例子:给我(绿色)我只想存储"绿色"这是我的管道声明:

curl -XPUT 'http://localhost:9200/xxx/pipeline/es' -d'
{
  "description" : "extracts information from parentheses ",
  "processors" : [
    {
      "grok" : {
        "field": "myfield",
        "pattern": "\\(([^)]+)\\)"
      }
    }
  ]
}'

我添加了双" \"解析所以语句使其成为ElasticSearch。 ES现在在日志中抛出这个错误:

  

MapperParsingException [无法解析];嵌套:JsonParseException [无法识别的字符转义'('(代码40)在[来源:org.elasticsearch.common.io.stream.InputStreamStreamInput@3f3f97ba;第8行,第21列]];

我把头发拉到这里......我希望这会是直截了当的;任何帮助都会非常感激!

0 个答案:

没有答案