Elasticsearch: Is it possible to use script files?

Hello,

for security reasons I’d like to disable dynamic scripting for my ElasticSearch cluster and would prefer to use script files. Is this supported in any way by Grafana?

Kind regards

P.S. I am using Grafana 4.5.2.

Don’t think so. How do you refer to script files in the query?

Given this very basic example:

"script": { 
  "source" : "(float)(doc['fieldA'].value) / doc['fieldB'].value)",
  "lang":"painless" 
}

You would just need to create a file in the appropriate directory (f.e. a_divided_by_b.painless)

"script": { 
  "file" : "a_divided_by_b",
  "lang":"painless" 
}