Http filter plugin adds _jsonparsefailure in tag

My logstash pipeline -

input { 
    elasticsearch {
		hosts => "http://localhost:9200"
		index => "s1test-processcode-temp"
	    user => "elastic"
	    password => "elastic"
		schedule => "*/10 * * * *"
	}
}
filter {
	json {	source => "message"}
	http {
		url 		=> "http://localhost:9200/s1test-processcode-%{[h][process-code]}"
		verb 		=> "HEAD"
		body_format => "json"
		user 		=> "elastic"
		password 	=> "elastic"
	}
        if "_httprequestfailure" not in [tags] {
               #further code
        }
}
output { 
    stdout {	codec => rubydebug }
}

This filter is used to check if index exists and based on outcome further conditions are added.
It works correctly but output has _jsonparsefailure in tag -

[2021-07-05T00:07:00,908][WARN ][logstash.filters.http    ][main][4036ec9991906132dfe17ead66655af37fb85b9a51eaf95e5aba43c9144d2e29] JSON parsing error {:message=>"class org.jruby.RubyNil cannot be cast to class org.jruby.RubyIO (org.jruby.RubyNil and org.jruby.RubyIO are in unnamed module of loader 'app')"}
{
          "tags" => [
        [0] "_jsonparsefailure"
    ],
    "@timestamp" => 2021-02-24T10:30:26.777Z,
         "docid" => "ed4af2a2-36ff-4127-b3c3-145b102538da",
       "headers" => {
          "content-type" => "application/json; charset=UTF-8",
        "content-length" => "3533"
    },
          "path" => "D:/elasticsearch-loyd/sampledata1.COMPLETED",
             "h" => {
          "process-ver" => 1,
             "guid" => "a057e0da-fba1-4002-8bf4-93c18fcc55c1",
               "id" => "preq1",
         "process-code" => "priyap1",
        "timestamp" => 1614072626771
    },
      "@version" => "1"
}

How to avoid _jsonparsefailure in tags ?

You could add

tag_on_json_failure => []

to your http filter.

Thanks @Badger .
Can you please provide documentation link ?
I searched tag_on_json_failure but not found anything.

You are right, it is undocumented, but my reading of the code suggests the filter supports it.

Ok, thanks :slight_smile:
My issue is resolved.
Hope, we will see this tag in documentation later - its very helpful.