Disabling check for non existing indices

Hi,

I have already used ELK 5.2 and i'm now testing ELK 5.6.7 (currently, the latest 5+ version).

When i'm automatically setting up my Elastic node, i configure the Kibana index-pattern.
Basically, I send some HTTP requests to the my elasticsearch. For example, for the index-pattern "syslog-*" i perform this kind of POST request:

curl -XPOST localhost:9200/.kibana/index-pattern/syslog-*/_create [...]

However, I encounter some error when i'm connecting to Kibana:

No matching indices found: No indices match pattern "syslog-*"

Right, since at this time Elastic does not have any "syslog-[...]" indices.

After some investigation, I found that the Kibana backend API is responsible of this error:

localhost:5601/api/index_patterns/_fields_for_wildcard?pattern=syslog-*

In Kibana 5.2 i didn't encounter any error when my Elasticsearch indices were not existing (probably because this API was not part of this version).

Is there a way to disable this type of error on Kibana (through its configuration file for example) or any workaround to don't check that the indices exist in Elasticsearch ?

Thanks in advance :slight_smile:

Best regards,

Hello,

This seems to be an open issue, we're investigating it. You can follow it for any updates.

Hi Marius,

Thanks for your answer, but i guess that it's not the same "issue".

In fact, I can create index pattern even with non existing Elastic indices (at the opposite of the issue given in your link).

In my case, i would like to disable the error message ("No matching indices found: [...]") that is displayed when i have an index pattern but no data in Elastic, thus no indices.

That is not configurable afaik, so you would have to modify the source an rebuild Kibana in order to remove that.

Yes, it seems that it's not configurable so I have modified the source code and rebuilt Kibana.

A possible way to do this, is to modify the file src/ui/public/index_patterns/_index_patterns.js and its refreshFields() function.

Its original content is the following one (comments has been removed):

refreshFields() {
  return fetchFields(this)
  .then(() => this.save())
  .catch((err) => {
    notify.error(err);
    if (err instanceof IndexPatternMissingIndices) {
      return [];
    }
    throw err;
  });
}

The modification performed to hide the error message is the following:

refreshFields() {
  return fetchFields(this)
  .then(() => this.save())
  .catch((err) => {
    if (err instanceof IndexPatternMissingIndices) {
      return [];
    }
    notify.error(err);
    throw err;
  });
}

Here, an error will be propagated but no error notification will be created, thus displayed in the Kibana interface.

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