# How to use ruby code to realize “i = i + 1" operation

**URL:** <https://discuss.elastic.co/t/how-to-use-ruby-code-to-realize-i-i-1-operation/197646>\
**Category:** Logstash\
**Created:** [September 2, 2019, 6:08am UTC](https://discuss.elastic.co/t/how-to-use-ruby-code-to-realize-i-i-1-operation/197646 "2019-09-02T06:08:08Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![terrymu](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@terrymu](https://discuss.elastic.co/u/terrymu)\
**Post date:** [September 4, 2019, 1:02am UTC](https://discuss.elastic.co/t/how-to-use-ruby-code-to-realize-i-i-1-operation/197646/8 "2019-09-04T01:02:59Z")

</div>

Hi Guyboertje,

I have adjust my ruby code, then this issue is resolved, the cause is i have referred the wrong data format that can't adapt the source log. Thank you.

But when I load my logstash script to parse my source log, i have met another performance issue.

`

> [2019-09-03T14:21:49,106][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"logstash-2019.09.03", :\_type=\>"\_doc", :\_routing=\>nil}, #LogStash::Event:0x1b6c342a], :response=\>{"index"=\>{"\_index"=\>"logstash-2019.09.03", "\_type"=\>"\_doc", "\_id"=\>"4\_PJ9WwB6iwMcN-ZT20T", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Limit of total fields [1000] in index [logstash-2019.09.03] has been exceeded"}}}}

`  
Would you please help me check it? It seems a parameter that limit the max index count. Of course I have found a solution, but I don't know how to use it.

The detailed information you can access this ticket:

![](https://us1.discourse-cdn.com/elastic/original/3X/6/f/6f174333fe1fc7ab7f2f87ea6397016d21213dfe.png) [Regarding to logstash performance limit](https://discuss.elastic.co/t/regarding-to-logstash-performance-limit/197763) [Logstash](https://discuss.elastic.co/c/logstash)

> Hi experts, I have met a logstash performance limit issue, when I parse my log, logstash report this error log: ` [2019-09-03T14:21:49,106][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"logstash-2019.09.03", :\_type=\>"\_doc", :\_routing=\>nil}, #LogStash::Event:0x1b6c342a], :response=\>{"index"=\>{"\_index"=\>"logstash-2019.09.03", "\_type"=\>"\_doc", "\_id"=\>"4\_PJ9WwB6iwMcN-ZT20T", "status"=\>400, "error"=\>{"type"=\>"…

Thank you again.  
[/quote]

---

_[View the full topic](https://discuss.elastic.co/t/how-to-use-ruby-code-to-realize-i-i-1-operation/197646)._
