[
https://issues.apache.org/jira/browse/NIFI-11784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17740841#comment-17740841
]
Mark Payne commented on NIFI-11784:
-----------------------------------
[~huntes5] I was able to reproduce this and dig into what's going on here. The
issue appears to be the fact that the content looks like this:
{code:java}
<Data
Name="SubjectUserSid">S-1-5-21-602162358-1060284298-1801674531-668877</Data>
<Data Name="SubjectUserName">visuserna</Data> {code}
So, specifically the XML has a "Data" element with an attribute named "Name"
and also has character data within the "Data" element. Now, the XML Reader
needs some way to map this into a more generic "Record" concept, which does not
have this concept of named attributes that exist within other named Records.
It determines that there is a Record named "Data". And that record has two
children: "Name" and.... well, here's the problem. It doesn't know what to call
the characters ( {{visuserna}} for example ). So instead of assigning some name
like {{value}} it logs the fact that it doesn't know what to do with it and
drops it. Unfortunately, it logs this at DEBUG level.
If you update your XML Reader to set the "Field Name for Content" property to
something - say {{Value}} then it will properly output those fields.
Which means: great news, there's a work around!
But this definitely is not ideal. It should have a default value for this, or
at a minimum log a warning, not just a DEBUG level message. I'm sorry this bit
you.
Given the attached sample, I saw the correct output when setting the "Field
Name for Content" property. Can you please set that on your end and confirm
that it addresses your issue in the full production data?
> XML to JSON conversion loses data (ConvertRecord processor - XMLReader and
> JSONRecordSetWriter)
> -----------------------------------------------------------------------------------------------
>
> Key: NIFI-11784
> URL: https://issues.apache.org/jira/browse/NIFI-11784
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 1.22.0
> Environment: Tested on Windows with ConsumeWindowsEventLog,
> particularly obvious (100% failure rate) on ForwardedEvents channel in a
> WEF/WEC setup
> Reporter: Sean Hunter
> Priority: Major
> Attachments: 735fcbc4-13ee-4b9e-bee0-91eb9084cb7e.xml,
> image-2023-07-06-14-42-46-700.png, image-2023-07-06-14-45-15-939.png,
> image-2023-07-06-15-04-04-992.png, image-2023-07-06-15-04-53-194.png
>
>
> Screenshot of event going into ConvertRecord processor in XML with valid data
> in SubjectUserName field (one example of data that's lost):
> !image-2023-07-06-14-42-46-700.png!
> Screenshot of the same flowfile once processed, showing that SubjectUserName
> field has lost information:
> !image-2023-07-06-14-45-15-939.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)