Ok. I stripped the namespace stuff - now I can parse.
Without xpath, I have:
input {
generator {
message => '<InvoiceQueryOpenRequest id="id1"><bankId>23</bankId><compId>533</compId><curr>949</curr><custId/><invCount>5</invCount><msgDate/><msisdn>1234567</msisdn><orig/><period>201901</period><procDate/><procTime/><sessionId>****</sessionId><stan>0</stan></InvoiceQueryOpenRequest>'
count => 1
}
}
filter {
xml {
remove_namespaces => true
store_xml => true
source => "[message]"
target => "[log_event]"
force_array => false
# force_content => false
# xpath =>{ "//InvoiceQueryOpenRequest/*/text()" => "nvoiceQueryOpenRequest" }
}
}
output {
stdout { codec => rubydebug }
}
Gives:
{
"host" => "Elastics-MacBook-Pro.local",
"sequence" => 0,
"message" => "<InvoiceQueryOpenRequest id=\"id1\"><bankId>23</bankId><compId>533</compId><curr>949</curr><custId/><invCount>5</invCount><msgDate/><msisdn>1234567</msisdn><orig/><period>201901</period><procDate/><procTime/><sessionId>****</sessionId><stan>0</stan></InvoiceQueryOpenRequest>",
"@version" => "1",
"@timestamp" => 2019-02-05T11:52:18.941Z,
"log_event" => {
"compId" => "533",
"custId" => nil,
"period" => "201901",
"procTime" => nil,
"sessionId" => "****",
"curr" => "949",
"invCount" => "5",
"stan" => "0",
"msgDate" => nil,
"id" => "id1",
"msisdn" => "1234567",
"orig" => nil,
"bankId" => "23",
"procDate" => nil
}
}
With xpath, I have:
input {
generator {
message => '<InvoiceQueryOpenRequest id="id1"><bankId>23</bankId><compId>533</compId><curr>949</curr><custId/><invCount>5</invCount><msgDate/><msisdn>1234567</msisdn><orig/><period>201901</period><procDate/><procTime/><sessionId>****</sessionId><stan>0</stan></InvoiceQueryOpenRequest>'
count => 1
}
}
filter {
xml {
remove_namespaces => true
# store_xml => true
store_xml => false
source => "[message]"
# target => "[log_event]"
force_array => false
# force_content => false
xpath =>{ "//InvoiceQueryOpenRequest/*/text()" => "nvoiceQueryOpenRequest" }
}
}
output {
stdout { codec => rubydebug }
}
Gives:
{
"@version" => "1",
"host" => "Elastics-MacBook-Pro.local",
"sequence" => 0,
"@timestamp" => 2019-02-05T11:54:28.911Z,
"nvoiceQueryOpenRequest" => [
[0] "23",
[1] "533",
[2] "949",
[3] "5",
[4] "1234567",
[5] "201901",
[6] "****",
[7] "0"
],
"message" => "<InvoiceQueryOpenRequest id=\"id1\"><bankId>23</bankId><compId>533</compId><curr>949</curr><custId/><invCount>5</invCount><msgDate/><msisdn>1234567</msisdn><orig/><period>201901</period><procDate/><procTime/><sessionId>****</sessionId><stan>0</stan></InvoiceQueryOpenRequest>"
}
Show us the shape that you want to see in your document then we can see if an xpath statement can be created.