nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Bende <bbe...@gmail.com>
Subject Re: Change Flowfile Name
Date Fri, 21 Sep 2018 20:15:43 GMT
There is extremely low chance of a collision where the same UUID could get
generated again, but I'm not sure how realistic that is in practice [1].

There is already an attribute called uuid on every flow file which is
assigned when the flow file is created internally in NiFi and then can't be
changed.

So if you are using a similar expression from earlier in this thread, you
could set filename to "Medical-$[fromDate}-${uuid}" or something like that.

[1]
https://en.wikipedia.org/wiki/Universally_unique_identifier#Random_UUID_probability_of_duplicates

On Fri, Sep 21, 2018 at 4:00 PM Rajesh Biswas <rajesh.biswas@bridgera.com>
wrote:

> Will be the UUID unique if we restart NiFi Server and create a new
> instance of Nifi Server.
> Would you please suggest a way to get the UUID and pass on as attribute
>
> Thank you very much for your support.
>
> Regards,
> Rajesh Biswas
>
> On Sat, Sep 22, 2018 at 1:24 AM Bryan Bende <bbende@gmail.com> wrote:
>
>> Filename is just a string attribute that could be anything, so it is not
>> unique. Every flow file has an attribute called uuid which is unique.
>>
>> NiFi could have a GetFile processor that picks up the same file over and
>> over and could have 100 flow files all with the same filename, but with
>> different uuids.
>>
>>
>> On Fri, Sep 21, 2018 at 3:25 PM Rajesh Biswas <rajesh.biswas@bridgera.com>
>> wrote:
>>
>>> Hello Bryan,
>>>
>>> Thank you very much for your suggestion, it worked after following your
>>> suggestion.
>>>
>>> I have one relative question here.
>>>
>>> Is the Flow File name unique? Will it remain unique if we restart the
>>> NiFi service.
>>>
>>> We do have a requirement to keep file name unique which we send to HTTP
>>> processor as Post request, the file became follow file content.
>>>
>>> How to make sure the file name will always be unique?
>>>
>>>
>>>
>>> Thanks and Regards,
>>>
>>> *Rajesh Biswas* | +91 9886433461 | www.bridgera.com
>>>
>>>
>>>
>>> *From:* Rajesh Biswas [mailto:rajesh.biswas@bridgera.com]
>>> *Sent:* Friday, September 21, 2018 7:09 PM
>>> *To:* dev@nifi.apache.org; bbende@gmail.com
>>> *Cc:* kolkata@bridgera.com; Joydeep Misra
>>> *Subject:* Change Flowfile Name
>>>
>>>
>>>
>>> Hello NiFi Dev Team,
>>>
>>> Would you please suggest how to change flow file name in Apache NiFi.
>>>
>>> We have use UpdatAttribute processor with below configuration, would you
>>> please suggest regarding the same
>>>
>>>
>>>
>>> Attribute Expression:
>>> ${filename:replace(${filename},"Medical"):append(${fromDate})}
>>>
>>>
>>>
>>> Please help me with your thought
>>>
>>> Thank you very much
>>>
>>>
>>>
>>> Thanks and Regards,
>>>
>>> *Rajesh Biswas* | +91 9886433461 | www.bridgera.com
>>>
>>>
>>>
>>>
>>>
>>>
>>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>>>
>>> Virus-free. www.avast.com
>>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>>>
>>>
>>>
>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message