I’m not sure if this is what you wanted but In Graylog configuration file you should have this line.
# Disable checking the version of Elasticsearch for being compatible with this Graylog release.
# WARNING: Using Graylog with unsupported and untested versions of Elasticsearch may lead to data loss!
elasticsearch_disable_version_check = true