Hi,

IIRC, according to the code you're right, heka doesn't handle such case.

That said, I've never seen a such ES response ... I'm interested about it.

Could you share these informations: the ES response, the ES version and ES
logs (when the thing happens)
also, what is your configuration on ES side? index template, field mapping ?

--
Swann



2016-04-26 22:28 GMT+02:00 Ramin Ali Dousti <[email protected]>:

> Hi,
>
> I have an ES output that bulk uploads to a cluster. The HTTP status code
> is 200 OK but the reply payload says that it failed the upload for a few of
> the items. But heka doesn't seem to care about the failed items. I looked
> at the code and it says:
>
>
> https://github.com/mozilla-services/heka/blob/dev/plugins/elasticsearch/elasticsearch.go#L429
>
> if response != nil {
>
>         defer response.Body.Close()
>
>         if response_body, err = ioutil.ReadAll(response.Body); err != nil {
>
>                 return fmt.Errorf("Can't read HTTP response body. Status:
> %s. Error: %s",
>
>                         response.Status, err.Error()), true
>
>         }
>
>         err = json.Unmarshal(response_body, &response_body_json)
>
>         if err != nil {
>
>                 return fmt.Errorf("HTTP response didn't contain valid
> JSON. Status: %s. Body: %s",
>
>                         response.Status, string(response_body)), true
>
>         }
>
>         json_errors, ok := response_body_json["errors"].(bool)
>
>         if ok && json_errors && response.StatusCode != 200 {
>
>                 return fmt.Errorf(
>
>                         "ElasticSearch server reported error within JSON.
> Status: %s. Body: %s",
>
>                         response.Status, string(response_body)), false
>
>         }
>
>         if response.StatusCode > 304 {
>
>                 return fmt.Errorf("HTTP response error. Status: %s. Body:
> %s", response.Status,
>
>                         string(response_body)), false
>
>         }
>
> }
>
>
> 1- In my case I see a 200 OK with "errors = true" which does not seem to
> be caught, according to the code.
> 2- I don't see any logic for recovery based on individual items. Am I
> missing anything here?
>
>
> --
> Ramin
>
> _______________________________________________
> Heka mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/heka
>
>
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to