How to update logstash 8.9.1 to 8.12.02

16 Views Asked by At

"Hi, this is Michael Mathan S. I'm trying to upgrade Logstash from version 8.9.1 to 8.12.2, but I'm encountering several errors. Could you please advise me on how to fix the following errors?

Error 1: [2024-03-20T11:56:35,871][ERROR][logstash.outputs.elasticsearch][main] Failed to install template: Got response code '400' contacting Elasticsearch at URL 'http://localhost:9200/_index_template/lims'. The error message indicates: 'x_content_parse_exception', with the reason being '[1:44] [index_template] unknown field [settings]'.

Error 2: [2024-03-21T15:10:04,942][ERROR][logstash.javapipeline][main] Pipeline error: NoMethodError: undefined method `serverless?' for #LogStash::Outputs::ElasticSearch::HttpClient::Pool:0x2373b975.

Attached are my logstash.config and LIMSIndices.json files for your reference.

[logstash.config contents]

# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  beats {
    client_inactivity_timeout => 600
    port => 5044
  }
}

filter{
    mutate{
        replace => [ "message", "%{message}" ]
        gsub => [ 'message','\n','']
    }

    if [message] =~ /^{.*}$/{
        json { source => message }
    }
}

output {
 if [fields][log_type] == "Order" {
      elasticsearch {
        hosts => ["http://localhost:9200/"]
        index => "lims-%{[fields][log_type]}-%{+yyyy-MM}"
        template_overwrite => "true"
        template_name => "lims"
        manage_template => true
        template => "../Logstash/LimsIndexTemplate/LIMSIndices.json"
        user => ["LimsKLESuperUser"]
        password => "${ES_PWD}"
      }
  }
  else{
      elasticsearch {
        hosts => ["http://localhost:9200/"]
        index => "lims-%{[fields][log_type]}-%{+yyyy}"
        template_overwrite => "true"
        template_name => "lims"
        manage_template => true
        template => "../Logstash/LimsIndexTemplate/LIMSIndices.json"
        user => ["LimsKLESuperUser"]
        password => "${ES_PWD}"
      }
     }
}

[LIMSIndices.json contents]

{
  "index_patterns" : "lims-*",
  "version" : 60001,
  "settings" : {
    "index.refresh_interval" : "5s",
    "index.mapping.total_fields.limit": 3000,
    "number_of_shards": 1,
    "number_of_replicas" : 0
  },
  "mappings" : {
    "dynamic_templates" : [ {
      "message_field" : {
        "path_match" : "message",
        "match_mapping_type" : "string",
        "mapping" : {
          "type" : "text",
          "norms" : false
        }
      }
    }, {
      "string_fields" : {
        "match" : "*",
        "match_mapping_type" : "string",
        "mapping" : {
          "type" : "text", "norms" : false,
          "fields" : {
            "keyword" : { "type": "keyword", "ignore_above": 256 }
          }
        }
      }
    } ],
    "properties" : {
      "@timestamp": { "type": "date"},
      "@version": { "type": "keyword"},
      "geoip"  : {
        "dynamic": true,
        "properties" : {
          "ip": { "type": "ip" },
          "location" : { "type" : "geo_point" },
          "latitude" : { "type" : "half_float" },
          "longitude" : { "type" : "half_float" }
        }
      }
    }
  }
}

Could you please review these and provide guidance? Thanks!"

0

There are 0 best solutions below