Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

[RESOLVED] NIFI : ListenHTTP : Header Regex

avatar
Rising Star

Hi all,

I wonder to send extract Attribute to ListenHTTP

Do you know how I write the rule from :

HTTP Headers to receive as Attributes (Regex) || Specifies the Regular Expression that determines the names of HTTP Headers that should be passed along as FlowFile attributes

My curl command :

curl -v --cacert nifi-cert.pem --cert ./client.p12 -X POST -H 'Content-Type: application/json' -H 'vartest1: v1' -F file=@/var/opt/hosting/log/flume/flume-a1.log.10 https://nifi012:10001/contentListener

How I can extract vartest1 as an attribute.

Many thanks.

1 ACCEPTED SOLUTION

avatar
Expert Contributor

@mayki wogno you should be able ot simply use the value "vartest1" (without quotes), if this is the only attribute you care about.

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

@mayki wogno you should be able ot simply use the value "vartest1" (without quotes), if this is the only attribute you care about.

avatar

I post the data using following curl command:

curl -H "hdfsdir:/Sandbox_Zone/Test/Landing_Zone/TestDir" -H "year:2017" -H "month:07" --data-binary "@client_mandate.csv" http://test:7000/hdfs_push

In the ListHttp processor I have specified the following as regex to read headers:

hdfsdir|year|month

Then I correctly get the attribtues

as hdfsdir, year and month