New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String conversion problem with select_jsonpath() function #68

lennartkoopmann opened this Issue Jul 29, 2016 · 1 comment


None yet
2 participants

lennartkoopmann commented Jul 29, 2016

Problem description

When trying to use the select_jsonpath() function, storing a message with an extracted String in Elasticsearch will fail:

2016-07-29T15:51:33.188-05:00 ERROR [BlockingBatchedESOutput] Unable to flush message buffer
java.lang.ClassCastException: Cannot cast com.fasterxml.jackson.databind.node.TextNode to java.lang.String
    at java.lang.Class.cast( ~[?:1.8.0_101]
    at org.graylog2.plugin.Message.getFieldAs( ~[graylog.jar:?]
    at org.graylog2.plugin.Message.getMessage( ~[graylog.jar:?]
    at org.graylog2.plugin.Message.toElasticSearchObject( ~[graylog.jar:?]
    at org.graylog2.indexer.messages.Messages.bulkIndex( ~[graylog.jar:?]
    at org.graylog2.indexer.messages.Messages.bulkIndex( ~[graylog.jar:?]
    at org.graylog2.outputs.ElasticSearchOutput.write( ~[graylog.jar:?]
    at org.graylog2.outputs.BlockingBatchedESOutput.flush( [graylog.jar:?]
    at org.graylog2.outputs.BlockingBatchedESOutput.forceFlushIfTimedout( [graylog.jar:?]
    at org.graylog2.periodical.BatchedElasticSearchOutputFlushThread.doRun( [graylog.jar:?]
    at [graylog.jar:?]
    at java.util.concurrent.Executors$ [?:1.8.0_101]
    at java.util.concurrent.FutureTask.runAndReset( [?:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301( [?:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ [?:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_101]
    at [?:1.8.0_101]

Calling to_string() on the extracted field works, but will wrap the string in quotes. I had to use another regex() function to get rid of the quotes.


  • Graylog Version: 2.1.0-beta.1
  • Pipeline Processor plugin version: 1.1.0-beta.1
  • Elasticsearch Version: 2.3.1

kroepke added a commit that referenced this issue Aug 2, 2016

unwrap JsonNode values
e.g. strings would be double quoted without this

fixes #68

This comment has been minimized.

tokred commented Aug 3, 2016

May I ask which rule code you used? Because for me, select_jsonpath is not working at all, however lacks an exception, see #40

@bernd bernd closed this in #72 Aug 8, 2016

bernd added a commit that referenced this issue Aug 8, 2016

unwrap JsonNode values (#72)
e.g. strings would be double quoted without this

fixes #68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment