There is no tags in XML


How can I write code in if condition, if there is no tags in XML.
For example, my xml source is like this :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<m2m:cin xmlns:m2m=""xmlns:xsi="">

And I can write if condition like this, if there is a tag :

filter {
          xml { 
                remove_namespaces => true
                xpath => ["/cin/ty", "ty"]

      if [ty] {

but, if there is no tag, is it right?

if(![ty]) {

Yes, that should work.

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