Could you give an example for the value of origine and the text you'd like to extract from it?
I think a grok with a pattern like %{GREEDYDATA:firstpart}:%{GREEDYDATA:secondpart}-%{GREEDYDATA:thirdpart} (But ideally more specific patterns than GREEDYDATA) should do it.
but when I try
ruby {
code => "
info = event.get('origine').split(':')[1]
event.set('source', info)
country = event.get('origine').split('\W')[1]
event.set('Countrysorigne', coutry)
"
}
I have no error and I have same message origine and Coutryorigine
If you are referring to my regex: That wasn't meant to be used as a separator for a split, but as an expression for grok or a ruby match function to directly extract TOTO into a field called yourinfo.
(And the code you posted is missing one ' as well was the // around the regex. That's probably why it is not only not working, but throwing an error.)
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.