Too many dynamic script compilations with inline script

(Matthew Field) #1

I am using an inline script with logstash.
However i am getting "too many dynamic script compilations" error.

I understand that this should not happen with an inline script, but it seems to be happening even if i simplify my script as shown.

My logstash config:

output {
  elasticsearch {
      hosts => [ "${ES_CLUSTER}" ]
      #hosts => [ "" ]
      index => "products"
      #user => "${ES_USERNAME}"
      #password => "${ES_PASSWORD}"
      action => "update"
      doc_as_upsert=> "true"
      #there must be a script called "tagger" on elasticsearch
      script => "tagger"
      #for indexed scripts must be left blank, lang is specified in the index, not here
      script_lang => ""
	  script_type => "indexed"
      document_id => "%{sku}"

And my script:

POST _scripts/tagger
  "script": {
    "lang": "painless",
    "source": "ctx._source.my_field = params.event.get('my_field');"

I am running on docker (docker config below, just in case)

    container_name: elasticsearch
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        soft: -1
        hard: -1
      - esdata1:/usr/share/docker/data-es
      - 9200:9200

Thanks in advance for any help.

(Matthew Field) #2

I found out myself why this was failing. There were 2 reasons . First was a syntax error in the script...silly me for not testing, and secondly, i had not taken into account that the script is stored on cluster, and not on disc. During development on docker, i was restarting the whole stack and so my script was no longer available to be used by logstash.

(system) #3

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