Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

[RESOLVED] NIFI : ListenHTTP : Header Regex

Solved Go to solution
Highlighted

[RESOLVED] NIFI : ListenHTTP : Header Regex

New Contributor

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

Accepted Solutions

Re: [RESOLVED] NIFI : ListenHTTP : Header Regex

Rising Star

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

2 REPLIES 2

Re: [RESOLVED] NIFI : ListenHTTP : Header Regex

Rising Star

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

Re: [RESOLVED] NIFI : ListenHTTP : Header Regex

New Contributor

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