# Logstash java.lang.unsupportedOperationException

**URL:** <https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057>\
**Category:** Logstash\
**Created:** [October 13, 2015, 5:45am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057 "2015-10-13T05:45:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![supermario](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@supermario](https://discuss.elastic.co/u/supermario)\
**Post date:** [October 13, 2015, 5:45am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/1 "2015-10-13T05:45:35Z")

</div>

I think through the TCP protocol to logstash from nxlog write log. But, i get some exceptions,excemple 'Exception in thread "\>elasticsearch.4 " java.lang.unsupportedoperationexception'.  
I try to reduce flush\_size in logstash config and increase to 1024MB for LS\_HEAP\_SIZE.However there is no use

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 13, 2015, 5:48am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/2 "2015-10-13T05:48:54Z")

</div>

Please show the full error message and stacktrace.

---

<div class="post-metadata">

**Author:** ![supermario](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@supermario](https://discuss.elastic.co/u/supermario)\
**Post date:** [October 13, 2015, 5:51am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/3 "2015-10-13T05:51:40Z")

</div>

![](https://us1.discourse-cdn.com/elastic/original/2X/2/21d9198c8b90e5fb13ce197938b3ad722a3e0058.jpg)

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 13, 2015, 6:14am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/4 "2015-10-13T06:14:04Z")

</div>

Next time, please copy/paste error messages instead of creating screenshots. It makes life easier for everyone, including yourself.

What's your configuration? Which JVM?

---

<div class="post-metadata">

**Author:** ![supermario](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@supermario](https://discuss.elastic.co/u/supermario)\
**Post date:** [October 13, 2015, 6:29am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/5 "2015-10-13T06:29:40Z")

</div>

I'm sorry , i will correct it.

JVM:  
java version "1.8.0\_60"  
Java(TM) SE Runtime Environment (build 1.8.0\_60-b27)  
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

logstash config:

input {  
tcp  
{  
codec =\> "json"  
type =\> "iis"  
port=\> 524  
}

redis {  
host =\> "127.0.0.1"  
data\_type =\> "list"  
port =\> "6379"  
key =\> "logstash:redis"  
threads =\> 10  
password =\> "\*\*\*\*\*"  
}

}

filter {  
if[type]=="iis"  
{  
mutate {  
rename =\> ["cs-host", "item"]  
add\_field =\> { "cs-host" =\> "%{item}" }  
}  
}  
}

output {  
stdout { }  
elasticsearch {  
host =\> "127.0.0.1"  
port =\> 9200  
protocol =\> "http"  
index =\> "logstash-%{type}-%{item}-%{+YYYY.MM.dd}"  
document\_type =\> "%{type}"  
workers =\> 100  
user=\>"_"  
password=\>"_\*\*\*\*\*"  
retry\_max\_interval=\>2  
retry\_max\_items=\>5000  
flush\_size=\>500  
}  
}

---

<div class="post-metadata">

**Author:** ![supermario](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@supermario](https://discuss.elastic.co/u/supermario)\
**Post date:** [October 13, 2015, 6:33am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/6 "2015-10-13T06:33:52Z")

</div>

This is the memory usage, memory loss is obvious

root@ubuntu:/usr/local/logstash/etc# free -m  
total used free shared buffers cached  
Mem: 7971 7731 239 15 257 3840  
-/+ buffers/cache: 3633 4337  
Swap: 1021 5 1016

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 13, 2015, 7:47am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/7 "2015-10-13T07:47:19Z")

</div>

> [@supermario](#):
>
> workers =\> 100

Why have you defined 100 worker threads for the Elasticsearch output? The Elasticsearch plugin collects events in order to submit bulk requests, so having lots of workers here will result in a lot of memory being used. This is rarely the limiting factor, so please reset this to the default value of 1 and see if that has any impact on memory usage. The increase it slowly to find the optimal value.

Also, which version of Logstash are you using?

---

<div class="post-metadata">

**Author:** ![supermario](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@supermario](https://discuss.elastic.co/u/supermario)\
**Post date:** [October 13, 2015, 8:14am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/8 "2015-10-13T08:14:57Z")

</div>

thank you for your reply.logstash 1.5.4

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:26am UTC](https://discuss.elastic.co/t/logstash-java-lang-unsupportedoperationexception/32057/9 "2017-07-06T05:26:43Z")

</div>


