This is a shell script question and not a Logstash question.
You can't invoke shell script functions directly from the outside. You'd have to write a.ksh in such a way that running ./a.ksh or ksh a.ksh (possibly with arguments) invokes the Test function.
Ruby code executing from a ruby filter is just ordinary Ruby code, it's just that it also has access to the Logstash event currently being processed. There must be a million examples out there of how to run a program from Ruby code.
If you explain what your end goal is we might be able to suggest something that doesn't involve running a shell interpreter for each message (since doing so can improve the event processing rate quite dramatically).
How to call a method of external ksh file(shell script) from filter block(of ruby code) of conf file(logstash file).
We need to pass an argument (i.e: count) from logstash file (This count variable will be used in Test( ) function ), to ksh file(shell script)'s function (i.e: Test () ).
After it, Test( ) function will return a value that value will be used in logstash file(conf file).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.