X-Path Wildcard

Hey,

Was wondering whether someone could help me with the following xpaths since I dont have much experience. I am trying to get the value of /eCloud1/CloudMsg/*/name() but this field can be 16 different values. I don't think the wildcard is allowed in logstash (it errors out), but i am not sure how to get the name?

Payload 1
<eCloud1> <CloudMsg> <PollRequest> <SrcCloudID>12345-12-12-12</SrcCloudID> <MsgSeq>12345-12345-12354-12345-12345</MsgSeq> </PollRequest> </CloudMsg> </eCloud1>

Payload 2
<eCloud1> <CloudMsg> <PosMsg> <SrcCloudID>12345-12-12-12</SrcCloudID> <MsgSeq>12345-12345-12354-12345-12345</MsgSeq> </PosMsg> </CloudMsg> </eCloud1>

That's xpath 2.0. Maybe the xpath 1.0 version will work:
name(/eCloud1/CloudMsg/*)

2 Likes

Brilliant @Jenni. Thanks for your help again. Can I assume logstash only supports xpath 1.0 version? Or is it kind of a grey area on what is supported and what isn't

I wasn't sure before because I rarely use it, but it seems like it really only supports 1.0 :expressionless:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.