0
votes

I am using the NiFi ListAzureBlobStorage to get the available blob objects. The processor creates a flowfile for each object with the attributes containing the object metadata. I want to filter on the azure.timestamp attribute, but I do not know what the numeric value represents and how it relates to the NiFi's expression language date data type. I want to compare it with a known date so I need to convert it to a NiFi data-time variable first. How do I do this?

Thanks

1
Could you add an example for such timestamp? - Ben Yaakobi

1 Answers

1
votes

According to the code it is already in "NiFi format" which means a Unix timestamp.

Since it represents the number of milliseconds passed since 1/1/1970, you can compare this and the other timestamp using regular number comparison operators. example: ${azure.timestamp:ge(${now()})} - this will return true if the azure.timestamp is later(or equal) than the current timestamp(now). If you'd like to compare it to another attribute you can do this: ${azure.timestamp:ge(${attribute.name})}.

If you'd like to convert a different date into a unix timestamp, you can use toDate and then toNumber, or to do the other way around, just use format.