Support Questions
Find answers, ask questions, and share your expertise

Error while adding TimeLine to file

I am using HDP 2.5. I try to add time for file which is locate in HDFS file. For that I use GetHDFS->UpdateAttribute->PutHDFS.

First I get file from HDFS through GetHDFS processor and then I change format of file in UpdateAttribute by adding property "

${filename}.${now():format("yyyy-MM-dd-HH:mm:ss.SSS'z'")}". Finally I put file in HDFS. In this stage I have one issue for example If destination folder(in HDFS) contain file which already have time line. Once I run flow in result two or more time line is present for same file

File which contain already timeline

39731-screenshot-from-2017-10-10-10-57-35.png


After flow of Nifi File contain two timeline

Can anyone tell how to resolve this issue

39732-screenshot-from-2017-10-10-10-57-12.png

4 REPLIES 4

Re: Error while adding TimeLine to file

@Narasimma varman

You can use Expression Langage to delete the previous timestamp and then add the current timestamp. You have several string functions such as substringBefore or substringAfter that you can use depending on the logic of your file names.

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html

Re: Error while adding TimeLine to file

Thanks Abdelkrim Hadjidj

Re: Error while adding TimeLine to file

I need to have different file with different timeline in same folder because i update file to specific folder in daily basic. Can anyone help me to resolve this issue

Re: Error while adding TimeLine to file

yes I successfully resolve this issue by using substringBefor()