Too many dynamic script compilations with inline script

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 => [ "127.0.0.1" ]
      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)

elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/docker/data-es
    ports:
      - 9200:9200

Thanks in advance for any help.

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.

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