@mtaka Sorry. You are right. My suggestion would work if we used DatetTimeFormatter to make the datetime conversion, but currently we use SimpleDateFormat, which does not support optional formatting. Currently there is no direct method to accomplish this. A reasonable approach is stagging the conversion in two separate phases: normalization and conversion. You first normalize fields using processor āField Replacerā. Then, having assured all fields have the same format, you convert them to datetime using āField Type Converterā processor. This is one replacement expression that would do the trick:
${str:length(record:value('/datetime')) > 20 ? record:value('/datetime') : str:concat(str:substring(record:value('/datetime'), 0, 19), '.000000Z')}
You will need to work the finer details if more input formats can appear.
I can send you a sample pipeline if you face some trouble configuring this.