WinlogBeat -> LogStash XML filter

Hey Guys,

Just asking myself how to configure the XML-Filter in logstash but not for a file input but a winlogbeat input.
Background: We're logging the ADFS Audit from our Win-ADFS Servers via Winlogbeat to elastic.

The Eventlog-Entry (on the windows server) for example looks like (my plan is to have every single xml-node as a field in elastic - actually I've all XML-Data in " event_data.param2") -->

XML: <?xml version="1.0" encoding="utf-16"?>
<AuditBase xmlns:xsd="" xmlns:xsi="" xsi:type="AppTokenAudit">
    <Component xsi:type="ResourceAuditComponent">
      <ClaimsProvider>AD AUTHORITY</ClaimsProvider>
    <Component xsi:type="AuthNAuditComponent">
    <Component xsi:type="ProtocolAuditComponent">
    <Component xsi:type="RequestAuditComponent">
      <UserAgentString>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36</UserAgentString>

Do you have any inputs for me on that?


No one?

I tried with -->

  if "adfs" in [tags] {
    xml {
      namespaces => {
        "xsd" => ""
        "xsi" => ""
      source => "event_data.param2"
      #target => "xmldata"
      store_xml => "false"
      xpath => ["/AuditBase/AuditType/text()","XML-AuditType"]
      xpath => ["/AuditBase/AuditResult/text()","XML-AuditResult"]
      xpath => ["/AuditBase/FailureType/text()","XML-FailureType"]

But nothing ....

Define "nothing"

Do you mean nothing as you don't see anything in Kibana/Elastic or do you mean nothing as in you get errors in Winlogbeat or Logstash on ingest?


Nothing - in my situation - means that the xml-data does not get splitted into separate fields. The data comes as it is. (whole XML data in one field)


I'm actually having the same issue with mine at the moment. Once upon a time I had it working great and then ran into a separate issue that's caused me to regress in my understanding of the XML filter. You could try using the xpath function of XML to tell it how to split the fields out....not sure if it's supposed to be able to dynamically create fields based on XML tags.

OK, I solved my issue which was completely irrelevant to yours, but it's restored my confidence, lol. First, let's change your xpath statement:

xpath => [

If that doesn't work, have you tried enabling debug/trace logging on logstash to see what kind of information you can glean when it tried to process one of these events?

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