# Logging failed shards in search response

**URL:** <https://discuss.elastic.co/t/logging-failed-shards-in-search-response/303109>\
**Category:** Elasticsearch\
**Created:** [April 25, 2022, 1:42am UTC](https://discuss.elastic.co/t/logging-failed-shards-in-search-response/303109 "2022-04-25T01:42:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nobuaki\_Ito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nobuaki_ito/32/102850_2.png) [@Nobuaki\_Ito](https://discuss.elastic.co/u/Nobuaki_Ito)\
**Post date:** [April 25, 2022, 1:42am UTC](https://discuss.elastic.co/t/logging-failed-shards-in-search-response/303109/1 "2022-04-25T01:42:13Z")

</div>

My team would like to keep track of occurrences of shard failures. Is there any way to enable logging of such events?

To clarify, the event that I would like to log is the occurrence of "failed" in the \_shards block of the search response.

````auto
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },```
````

---

<div class="post-metadata">

**Author:** ![Nobuaki\_Ito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nobuaki_ito/32/102850_2.png) [@Nobuaki\_Ito](https://discuss.elastic.co/u/Nobuaki_Ito)\
**Post date:** [May 9, 2022, 3:50am UTC](https://discuss.elastic.co/t/logging-failed-shards-in-search-response/303109/2 "2022-05-09T03:50:23Z")

</div>

Any ideas on how this could be done?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 6, 2022, 3:50am UTC](https://discuss.elastic.co/t/logging-failed-shards-in-search-response/303109/3 "2022-06-06T03:50:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
