HI, I am trying to pass data from logstash to ES index, but it throws error as shown below
2022-07-28T10:28:17,909][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"100", :_index=>"stm-staff-profile-index-v120", :_routing=>nil, :_type=>"doc"}, #<LogStash::Event:0x75fd1305>], :response=>{"index"=>{"_index"=>"stm-staff-profile-index-v120", "_type"=>"doc", "_id"=>"100", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Mapper for [can_display_user_weight] conflicts with existing mapper:\n\tCannot update parameter [index] from [false] to [true]"}}}
Input plugin is as shown below
input {
jdbc {
tags => "staff"
jdbc_connection_string => "jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}"
jdbc_user => "${DB_USER}"
jdbc_password => "${DB_PASSWORD}"
schedule => "* * * * *"
jdbc_driver_class => "org.postgresql.Driver"
statement_filepath => "/staffboard-logstash/queries/stm-staff-query.sql"
use_column_value => true
tracking_column => "last_updated"
tracking_column_type => "timestamp"
last_run_metadata_path => "/usr/share/logstash/logstash_jdbc_last_run_stm_staff_profile"
jdbc_paging_enabled => true
jdbc_page_size => 10000
jdbc_fetch_size => 10000
}
}
Output plugin is as shown below
if "staff" in [tags] {
stdout {
codec => json
}
elasticsearch {
hosts => ["${ELASTIC_HOST}"]
ssl => true
index => "stm-staff-profile-index-v125"
document_id => "%{sb_id}"
user => "${ELASTIC_USER_NAME}"
password => "${ELASTIC_PASSWORD}"
ilm_enabled => false
manage_template => true
template => "/staffboard-logstash/mappings/stm/stm-staff-profile-index.json"
template_name => "stm-staff-profile-index-mapping-125"
template_overwrite => true
}
}
Mapping file is as shown below
{
"template": "stm-staff-profile-index-v125",
"version": 1,
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"account_type": {
"type": "keyword"
},
"user_name_kana": {
"type": "keyword"
},
"shop_code": {
"type": "keyword"
},
"shop_number": {
"type": "keyword"
},
"store_account_id": {
"type": "keyword"
},
"shop_name": {
"type": "keyword"
},
"user_code": {
"type": "keyword"
},
"sb_id": {
"type": "integer",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"user_name": {
"type": "keyword"
},
"user_nickname": {
"type": "keyword"
},
"crowned_staff": {
"type": "boolean"
},
"store_visit": {
"type": "boolean"
},
"status": {
"type": "keyword"
},
"branch_cd": {
"type": "keyword"
},
"role_name": {
"type": "keyword"
},
"label_code": {
"type": "keyword"
},
"group_id": {
"type": "keyword"
},
"sns_approval_status.approval_status": {
"type": "keyword"
},
"sns_approval_status.sns_type": {
"type": "keyword"
},
"sns_approval_status.sns_handle": {
"type": "text",
"index": false
},
"age_range": {
"type": "text",
"index": false
},
"bio": {
"type": "text",
"index": false
},
"body_characteristics": {
"type": "text",
"index": false
},
"branch_name": {
"type": "text",
"index": false
},
"can_display_age": {
"type": "boolean",
"index": false
},
"can_display_bio": {
"type": "boolean",
"index": false
},
"can_display_body_characteristics": {
"type": "boolean",
"index": false
},
"can_display_body_shape": {
"type": "boolean",
"index": false
},
"can_display_date_of_birth": {
"type": "boolean",
"index": false
},
"can_display_fav_styling": {
"type": "boolean",
"index": false
},
"can_display_front_label": {
"type": "boolean",
"index": false
},
"can_display_gender": {
"type": "boolean",
"index": false
},
"can_display_have_child": {
"type": "boolean",
"index": false
},
"can_display_interest": {
"type": "boolean",
"index": false
},
"can_display_personal_color": {
"type": "boolean",
"index": false
},
"can_display_profile_on_st": {
"type": "boolean",
"index": false
},
"can_display_shoe_size": {
"type": "boolean",
"index": false
},
"can_display_shoulder_stature": {
"type": "boolean",
"index": false
},
"can_display_size": {
"type": "boolean",
"index": false
},
"can_display_store": {
"type": "boolean",
"index": false
},
"can_display_user_bottom_size": {
"type": "boolean",
"index": false
},
"can_display_user_height": {
"type": "boolean",
"index": false
},
"can_display_user_name": {
"type": "boolean",
"index": false
},
"can_display_user_top_size": {
"type": "boolean",
"index": false
},
"can_display_user_weight": {
"type": "boolean",
"index": false
},
"coubic_url": {
"type": "text",
"index": false
},
"created_at": {
"type": "date",
"index": false
},
"csvideo_count": {
"type": "integer",
"index": false
},
"cumulation_count": {
"type": "integer",
"index": false
},
"dob": {
"type": "date",
"index": false
},
"fav_styling_1": {
"type": "text",
"index": false
},
"fav_styling_2": {
"type": "text",
"index": false
},
"fav_styling_3": {
"type": "text",
"index": false
},
"follower_count": {
"type": "integer",
"index": false
},
"front_display_label_code": {
"type": "text",
"index": false
},
"front_display_label_name": {
"type": "text",
"index": false
},
"have_child": {
"type": "text",
"index": false
},
"interests": {
"type": "text",
"index": false
},
"is_post_approval_required": {
"type": "boolean",
"index": false
},
"label_name": {
"type": "text",
"index": false
},
"label_name_kana": {
"type": "text",
"index": false
},
"last_updated": {
"type": "date",
"index": false
},
"last_updated_stm": {
"type": "date",
"index": false
},
"personal_color": {
"type": "text",
"index": false
},
"sb_permission_id": {
"type": "integer",
"index": false
},
"sb_role_id": {
"type": "integer",
"index": false
},
"shop_name_kana": {
"type": "text",
"index": false
},
"shoulder_stature": {
"type": "text",
"index": false
},
"store_prefecture_code": {
"type": "text",
"index": false
},
"styling_count": {
"type": "integer",
"index": false
},
"tags": {
"type": "text",
"index": false
},
"user_body_shape": {
"type": "text",
"index": false
},
"user_bottom_size": {
"type": "text",
"index": false
},
"user_gender": {
"type": "text",
"index": false
},
"user_height": {
"type": "text",
"index": false
},
"user_image_url": {
"type": "text",
"index": false
},
"user_shoe_size": {
"type": "text",
"index": false
},
"user_top_size": {
"type": "text",
"index": false
},
"user_weight": {
"type": "text",
"index": false
},
"weight_range": {
"type": "text",
"index": false
}
}
}
}
I understand that the mapping that I provided is not taken into consideration. I think it is trying to apply a default mapping different from the one I have given while passing data from logstash to ES.
Any help is appreciated. Thank you in advance