Is there a working example of how to create a plugin?

No, calling a C/C++ .so library still important. GrayLog misses any readable and systematic documentation. A simple task of text line parsing is made impossible.

How to build a plugin that calls a C/C++ function from a .so library that takes a string of text and returns a json object?

The descriptions I find produce useless code that just simply opened with IntelliJ IDEA is full of errors: