<p dir="auto">Looks like currently we dont add alias name to slow query logs, Also I doubt if it adds the filter used in alias as well .</p>
<p dir="auto">May be we need to update -&gt; <a href="https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/search/slowlog/ShardSlowLogSearchService.java#L185">https://github.com/elastic/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/search/slowlog/ShardSlowLogSearchService.java#L185</a> and  add alias name + Context.aliasFilter ?</p>
<p dir="auto">When using filtered aliases filtered by type, it will be helpful for slowlog to report the types queried.   Currently, it returns <code class="notranslate">types[]</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="POST /_aliases
{
  &quot;actions&quot;: [
    {
      &quot;add&quot;: {
        &quot;index&quot;: &quot;index_name&quot;,
        &quot;alias&quot;: &quot;slowlogalias&quot;,
        &quot;filter&quot;: {
          &quot;term&quot;: {
            &quot;_type&quot;: &quot;doc_type&quot;
          }
        }
      }
    }
  ]
}"><pre class="notranslate"><code class="notranslate">POST /_aliases
{
  "actions": [
    {
      "add": {
        "index": "index_name",
        "alias": "slowlogalias",
        "filter": {
          "term": {
            "_type": "doc_type"
          }
        }
      }
    }
  ]
}
</code></pre></div>