Logstash合并数组中的值

时间:2018-10-09 14:37:38

标签: elasticsearch logstash

我正在尝试从数组键[files][MD5]中提取新值,并为md5_hashes创建一个新字段,其中将包含数组键。

输入:

     "files": [{
            "SHA256": "1213447D713ECA24484983E754474D9D2F4A283D77DDBD9C8084CD7AA0574ACF",
            "MD5": "7D332F11DD7389C8121AA523F07CFEEC",
            "SHA1": "6026B28C6049115272138AD357A5AF67B99354A5"
        }, {
            "SHA256": "1213447D713ECA24484983E754474D9D2F4A283D77DDBD9C8084CD7AA0574ACF",
            "MD5": "7D332F11DD7389C8121AA523F07CFEEC",
            "SHA1": "6026B28C6049115272138AD357A5AF67B99354A5"
        }, {
            "SHA256": "1212447D713ECA24484983E754474D9D2F4A283D77DDBD9C8084CD7AA0574ACF",
            "MD5": "7D332F11DD7389C8121AA523F07CFEEC",
            "SHA1": "6026B28C6049115272138AD357A5AF67B99354A5"
        }
     ]

预期输出: "md5_hashes":["7D332F11DD7389C8121AA523F07CFEEC","7D332F11DD7389C8121AA523F07CFEEC","7D332F11DD7389C8121AA523F07CFEEC"]

我的过滤器:

mutate {add_field => {"md5_hashes" => "%{[files][MD5]}"}}

有没有一种方法可以使用Logstash 6.4?

0 个答案:

没有答案