Hi All,
I have the following logstash pipeline configuration.
input {
tcp {
port => 5102
codec => json
}
}
filter {
json {
source => "message"
}
}
output {
stdout {
codec => rubydebug
}
}
The message that I am receiving over TCP socket is below:
{
"node" => "node0",
"@version" => "1",
"data" => "R25BZhcAAAAAAAAAAAAAAAACAAAAgAAAAAAAAAAAAAAHAAMAAgAAABAYAQABAAAAAAAAAAAAAABAAAAAABAAACApAAAAAAAAAAAAAAAAAAAAAQAAAEAAAJCYAAAAAAAAAAAAAAAAAAAAAQAAAEAAAJCYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEYRAABGEQABAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAEAAAACAAAAAAAEAAAEAAAABAAAAAQAAAIQjCzQmFy0X//////////8AgAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAARREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHqWAAACEwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOYUl0EwAAAGx3bWxpYi8xX3N5c2RiX3NoYXJlZF9zYy9kYmcA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AAAAQEQAMJH8AAJkvyoCIAAAA0HECAJIRAAAOBQEAAwAAAAAAAAAAAAAABAAAAAAAAAABAAcAAAAAADIYAAAAAAAACwAAAAAAAAAOAAAAAAAAAAEAAAAAAAAAEBEADCR/AACXM8qAiAAAANFxAgCSEQAAGgUBAAUAAAAAAAAAAAAAAAQAAAAAAAAATgAAAAAAAAAAAAAAAAAAACgAAAAAAAAAhBgAAAAAAAAAAAAAAAAAABARAAwkfwAAZkPKgIgAAADScQIAkhEAAAoFAQAGAAAAAAAAAAAAAACgEwAMJH8AAAEADgAAAAAA8yYAAAAAAAAAAAAAAAAAAMB7eSckfwAAAQAAAAAAAAAQEQAMJH8AACniy4CIAAAA03ECAHARAAAJBQEABAAAAAAAAAAAAAAAAQAOAAAAAABiAAAAAAAAAAIAAAAAAAAAAAAAAAAAAADAe3knJH8AAAEAAAAAAAAAEBEADCR/AACD5MuAiAAAANRxAgBwEQAAFQUBAAUAAAAAAAAAAAAAAAEADgAAAAAAtBEAAAAAAABjAAAAAAAAAAsAAAAAAAAACwAAAAAAAAABAAAAAAAAABARAAwkfwAARAXMgIgAAADVcQIAkhEAAAsFAQAHAAAAAAAAAAAAAACgEwAMJH8AAAEADgAAAAAA8yYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEQAMJH8AAA1SzICIAAAA2nECAJIRAAA=",
"buffer" => "test/dbg",
"@timestamp" => 2022-12-02T21:38:10.842695522Z
}
The data field in the above JSON message is Base64 encoded and I want to decode this and store it in a file using the "node" and "buffer" field values. Considering the above example, I want to store the bas64 decoded data in a file named "node0/test/dbg".
Can someone tell how to achieve this?
Thanks,
Arinjay