Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

NiFi - TailFile - try to read multiple files , unable to read.

avatar
Explorer

HI ALL,

i am try to read multiple files from particular location.

TailFile.png

Logs will generate every 1 minute , it will create new file.

i am getting below error. 

ERROR [Timer-Driven Process Thread-3] o.a.nifi.processors.standard.TailFile TailFile[id=3f714fb2-72eb-1376-037b-167383110223] Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to java.util.regex.PatternSyntaxException: Unknown character property name {In/IsY} near index 14
D:\Softwares\PYTHON-YOUTUBE\SIMULATION\modbus_logs\Q\\E^modbus_log\.\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$
              ^
java.util.regex.PatternSyntaxException: Unknown character property name {In/IsY} near index 14
D:\Softwares\PYTHON-YOUTUBE\SIMULATION\modbus_logs\Q\\E^modbus_log\.\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$
              ^
    at java.base/java.util.regex.Pattern.error(Pattern.java:2027)
    at java.base/java.util.regex.Pattern.family(Pattern.java:2916)
    at java.base/java.util.regex.Pattern.sequence(Pattern.java:2155)
    at java.base/java.util.regex.Pattern.expr(Pattern.java:2068)
    at java.base/java.util.regex.Pattern.compile(Pattern.java:1782)
    at java.base/java.util.regex.Pattern.<init>(Pattern.java:1428)
    at java.base/java.util.regex.Pattern.compile(Pattern.java:1068)
    at org.apache.nifi.processors.standard.TailFile.getFilesToTail(TailFile.java:525)
    at org.apache.nifi.processors.standard.TailFile.lookup(TailFile.java:386)
    at org.apache.nifi.processors.standard.TailFile.recoverState(TailFile.java:410)
    at jdk.internal.reflect.GeneratedMethodAccessor1142.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:145)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:133)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:78)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:55)
    at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$8(StandardProcessorNode.java:1736)
    at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
 
 
How to resolve this issue.
 
in modbus_logs dir file name are like modbus_log.2023-09-06_16-16,modbus_log.2023-09-06_16-17,modbus_log.2023-09-06_16-18,modbus_log.2023-09-06_16-19.
2 REPLIES 2

avatar
Super Collaborator

This doesn't look like a valid regex pattern
\E^modbus_log\.\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$
Maybe it should be
^modbus_log\.\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$

avatar
Master Mentor

@Kumar_ 
Check the configuration value boxes to see if you added a line return.
If the configuration pop-up box shows more then just a "1" line then you have a lone return at the end of line "1".  Click on line to and hit delete to get rid of the line return if present.

MattWho_0-1695066306024.png

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt