Hello.
I have my pipeline configured as follows:
    ...
      mutate {
       add_field => { "append_request_history_array" => [ "%{time_local}, host:%{host}, request_uri:%{request_uri}, user_agent:%{user_agent}] }
      }
      
     fingerprint {
       method => "MD5"
       source => ["myheader"]
       target => ["fingerprint"]
      }
      elasticsearch {
       hosts => ["localhost:9200"]
       index => "logs"
       query => '_id=%{fingerprint}'
       fields => { "request_history_array" => "request_history_array" }
      }
       ruby {
        code => '
         event.set("request_history_array", event.get(request_history_array) + ["append_request_history_array"])
        '
       }
    ...
I get error:
    [2019-02-04T12:53:50,742][ERROR][logstash.filters.ruby    ] Ruby exception occurred: undefined local variable or method `request_history_array' for #<LogStash::Filters::Ruby:0x5d573291>
Why is that? The requested field exists in elasticsearch index that I query.