# Turn off source for search slow logs

**URL:** <https://discuss.elastic.co/t/turn-off-source-for-search-slow-logs/71182>\
**Category:** Elasticsearch\
**Created:** [January 11, 2017, 7:20am UTC](https://discuss.elastic.co/t/turn-off-source-for-search-slow-logs/71182 "2017-01-11T07:20:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [January 11, 2017, 7:20am UTC](https://discuss.elastic.co/t/turn-off-source-for-search-slow-logs/71182/1 "2017-01-11T07:20:47Z")

</div>

Two questions:

1. Per [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-slowlog.html), you can turn off source for indexing slow log by

I was wondering if there is a way to turn off source for search slow logs.

Business Justification: We do not want to log sensitive information (PII) in the logs that can breach any contracts with customers. Please let me know if that is doable or if there is any workaround for the same.

1. In relation to above question: We enable slow logs for latency metrics. One quick observation is that the latency logged in slow logs for search is different than the one logged in the response payload.

E.g.

Response Payload shows 10 ms

```
{
   "took": 10,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
}

```

Slow Log shows 0ms

`[2017-01-11T06:32:21,452][INFO][index.search.slowlog.query] [esdatanode1] [twitter] took[490.8micros], took_millis[0], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[{truncated}]`

My best logical guess is that search logs are divided into query and fetch logs, plus the query is forwarded to each shard, in this case 5. So, the log pasted above is only for one shard and the latency is for fetching the data for that particular shard.

Assuming that my guess is correct, what is the best way to measure search and index latencies (We are using telegraf plugin for metrics as well). I didn't find a log that logs aggregated latency for all shards.

Thank you.

---

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [January 12, 2017, 9:59pm UTC](https://discuss.elastic.co/t/turn-off-source-for-search-slow-logs/71182/2 "2017-01-12T21:59:22Z")

</div>

For 1. I have submitted a PR

See [https://github.com/elastic/elasticsearch/issues/22683](https://github.com/elastic/elasticsearch/issues/22683) for more info

---

<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:** [February 9, 2017, 9:59pm UTC](https://discuss.elastic.co/t/turn-off-source-for-search-slow-logs/71182/3 "2017-02-09T21:59:29Z")

</div>

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