Hi,
My pipeline not working with ouput elasticsearch, I created user and role like this:
root@logserver:/home/g0004830# curl -k -u admin:my_password -XGET "http://localhost:9200/_security/user/syslog?pretty"
{
"syslog" : {
"username" : "syslog",
"roles" : [
"syslog"
],
"full_name" : null,
"email" : null,
"metadata" : { },
"enabled" : true
}
}
root@logserver:/home/g0004830# curl -k -u admin:my_password -XGET "http://localhost:9200/_security/role/syslog?pretty"
{
"syslog" : {
"cluster" : [ ],
"indices" : [
{
"names" : [
"syslog-*"
],
"privileges" : [
"read",
"write"
],
"allow_restricted_indices" : false
}
],
"applications" : [ ],
"run_as" : [ ],
"metadata" : { },
"transient_metadata" : {
"enabled" : true
}
}
}
And my output config:
output {
stdout {
codec => rubydebug
}
elasticsearch {
user => "syslog"
password => "my_password"
hosts => [ "http://localhost:9200/" ]
index => "syslog-%{+YYYY-MM-dd}"
}
}
When I run logstash I receive this error:
[WARN ] 2022-06-23 23:48:20.422 [Ruby-0-Thread-9: :1] elasticsearch - Attempted to resurrect connection to dead ES instance, but got an error {:url=>"http://syslog:xxxxxx@localhost:9200/", :exception=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :message=>"Got response code '403' contacting Elasticsearch at URL 'http://localhost:9200/'"}
How can I solve this?