Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not index event to Elasticsearch #142

Closed
Beren43 opened this issue Oct 15, 2019 · 2 comments
Closed

Could not index event to Elasticsearch #142

Beren43 opened this issue Oct 15, 2019 · 2 comments

Comments

@Beren43
Copy link

Beren43 commented Oct 15, 2019

The error was discovered. If there are many indexes , then logstash will be in the logs
Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"%{id}", :_index=>"_integration_ms", :_type=>"integr_sybase", :routing=>nil}, #LogStash::Event:0x44b7f68], :response=>{"index"=>{"_index"=>"_integration_ms", "_type"=>"integr_syb", "_id"=>"%{id}", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [host] of type [text] in document with id '%{id}'. Preview of field's value: '{name=mail1.domain.com}'", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Can't get text on a START_OBJECT at 1:299"}}}}} . That is, filebeat tries to write data to each index.
If in logstash
output {
if "postfix" in [tags]{
elasticsearch {
hosts => "localhost:9200"
index => "postfix-%{+YYYY.MM.dd}"
}
}
}

and filebeat.yml
filebeat.inputs:

  • type: log
    enabled: true
    paths:
    - /var/log/maillog*
    exclude_files: [".gz$"]
    tags: ["postfix"]
    output.logstash:
    hosts: ["10.50.11.8:5044"]

in logs the same errors and the index is not created.
Can you help ?

@whyscream
Copy link
Owner

I am by no means an elasticsearch or logstash guru. Please try: https://discuss.elastic.co/

@Beren43
Copy link
Author

Beren43 commented Oct 17, 2019

Thanks. In https://discuss.elastic.co answered
"
That is, we had a document with id mgaz20Bp3jq-MOqGvqp, and it had a host field that Elasticsearch tried to interpret as text but couldn't. Racit in the document was something like {..... "host": {"name": "elk.domain.com"} ...} and judging by

"reason"=>"Can't get text on a START_OBJECT at 1:357"

It happened on the 357th symbol.

Result: the mapping for the host field in the index does not match the information being sent.
"

Can you help how to rename host field to server ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants