logstash check if field exists

前端 未结 4 800
清酒与你
清酒与你 2020-12-13 08:27

I have log files coming in to an ELK stack. I want to copy a field (foo) in order to perform various mutations on it, However the field (foo) isn\'t always present.

4条回答
  •  孤城傲影
    2020-12-13 09:08

    "foo" is a literal string.

    [foo] is a field.

    # technically anything that returns 'true', so good for numbers and basic strings:
    if [foo] {
    }
    
    # contains a value
    if [foo] =~ /.+/ {
    }
    

提交回复
热议问题