Member since
05-20-2022
66
Posts
6
Kudos Received
6
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1149 | 07-17-2023 11:25 PM | |
1141 | 04-17-2023 02:29 PM | |
5398 | 02-15-2023 08:47 PM | |
876 | 02-08-2023 06:02 PM | |
4317 | 10-17-2022 11:48 AM |
05-22-2023
07:58 AM
It sounds like you are using OAuth, which means you ought to be using an OAuth2AccessTokenProvider controller service. See my screen shot, which shows that inside the InvokeHTTP there is a configuration line that lets you specify this controller service. This service automatically handles getting the token for you and embedding it in the header so your flowfile remains intact. This will greatly simplify your current flow because you can get rid of the map cache and that whole process cycle.
... View more
04-17-2023
02:29 PM
Thank you @SAMSAL. I can always count on you to respond with good ideas. It didn't occur to me to include just a single parameter in the math function because the documentation shows using "scalb" and "pow" methods with the second parameter as the value to pass to the input method. But also, I was trying to use a Double because they documentation says "toRadians" only accepts a double, and the NiFi expression language docs shows using a "toDouble()", but "toDouble" doesn't seem to be supported. Seems to be an inconsistency in the docs. Your suggestions were pretty close. Below is the final result which did the trick. ${latitude:toDecimal():math("toRadians")} Thank you again!
... View more
04-04-2023
01:57 PM
Hello, I am attempting to use the NiFi ConnectWebSocket processor but not having any luck. I have my JettyWebSocketClient WebSocket URI set to my web socket url. Then I configure the ConnectWebSocket with the JettyWebSocketClient, and set the "WebSocket Client Id" to a unique name. Seemingly all very simple, however, it ain't working for me. What am I doing wrong here; why can't I receive the web socket data?
... View more
Labels:
- Labels:
-
Apache NiFi
02-15-2023
08:47 PM
I figured this out. The problem was that I was missing two things. 1. I need another processor BEFORE the InvokeHTTP processor to send in a flow file and trigger the InvokeHTTP processor. Seems obvious now, but didn't dawn on me at the time. 2. I need the sql query to be in the body of the flow file, which I accomplish by using a GenerateFlowFile processor in front of the InvokeHTTP processor, and then set the "Custom Text" field to my SQL query. This also satisfies the first requirement of needing an incoming flow file to trigger the InvokeHTTP processor. It is literally that simple. I didn't need to specify the attributes to include or anything else. However, I did specify the Content-Type as "text/plain".
... View more
02-08-2023
06:02 PM
1 Kudo
I resorted to using an Avro schema with the RecordsetWriter in order to coerce the values into numbers. So even though the documentation says toNumber's return type is "Number", it doesn't get expressed that way. But the schema fixes it so its all good.
... View more
02-02-2023
09:12 AM
Hi @SAMSAL , Ugh! That is a little disconcerting to hear about the "wrapper" and "insertion" strategies. I resorted to using the "wrapper" strategy and then follow up with a Jolt transform to get the data into the format I want. However, if you think using SQL is a more bullet proof option then I'm open to that if you know how to write a SQL that uses RecordPath to put the data into the structure I need. Here is an example dataset, which gives me the exact same outcome. The incoming flow file is OpenSky flight data, and the primary key is "hex". Using an UpdateRecord processor, I add the field "aircraft": "placeholder" because the JoinEnrichment processor requires that the field already exist before inserting the enrichment data. The second dataset is my enrichment data, which is a record in a large dataset called UnitedAirlinesFleet, and "icao24" is the foreign key. So "hex" and "icao24" are the two keys. I want to do something very simple, which is to insert the enrichment data into flight data as a record where the field name is "aircraft", as shown in the third dataset below. I believe this is precisely what the insertion strategy is designed to do. I really appreciate you SAMSAL and your expertise. Your suggestion to use the ForkEnrichment and JoinEnrichment was really helpful. I subsequently found a Cloudera video on this topic and that also helped a lot with how to structure the flow. Thank you. {
"hex" : "a39fb1",
"flight" : "UAL798 ",
"alt_baro" : 23000,
"alt_geom" : 23200,
"gs" : 415.2,
"track" : 275.9,
"baro_rate" : 2432,
"squawk" : "1467",
"emergency" : "none",
"category" : "A3",
"nav_qnh" : 1013.6,
"nav_altitude_mcp" : 26016,
"nav_heading" : 270.0,
"lat" : 39.969681,
"lon" : -105.610657,
"nic" : 8,
"rc" : 186,
"seen_pos" : 1.1,
"version" : 2,
"nic_baro" : 1,
"nac_p" : 9,
"nac_v" : 1,
"sil" : 3,
"sil_type" : "perhour",
"gva" : 2,
"sda" : 2,
"mlat" : [ ],
"tisb" : [ ],
"messages" : 876,
"seen" : 1.1,
"rssi" : -1.8,
"aircraft" : "placeholder"
} {
"icao24" : "a39fb1",
"registration" : "N33203",
"manufacturericao" : "BOEING",
"manufacturername" : "Boeing",
"model" : "737-824",
"typecode" : "B738",
"serialnumber" : 30613,
"linenumber" : null,
"icaoaircrafttype" : "L2J",
"operator" : null,
"operatorcallsign" : "UNITED",
"operatoricao" : "UAL",
"operatoriata" : null,
"owner" : "Wells Fargo Trust Co Na Trustee",
"testreg" : null,
"registered" : null,
"reguntil" : "2023-07-31",
"status" : null,
"built" : "2000-01-01",
"firstflightdate" : null,
"seatconfiguration" : null,
"engines" : "CFM INTL. CFM56 SERIES",
"modes" : false,
"adsb" : false,
"acars" : false,
"notes" : null,
"categoryDescription" : "No ADS-B Emitter Category Information"
} {
"hex" : "a39fb1",
"flight" : "UAL798 ",
"alt_baro" : 23000,
"alt_geom" : 23200,
"gs" : 415.2,
"track" : 275.9,
"baro_rate" : 2432,
"squawk" : "1467",
"emergency" : "none",
"category" : "A3",
"nav_qnh" : 1013.6,
"nav_altitude_mcp" : 26016,
"nav_heading" : 270.0,
"lat" : 39.969681,
"lon" : -105.610657,
"nic" : 8,
"rc" : 186,
"seen_pos" : 1.1,
"version" : 2,
"nic_baro" : 1,
"nac_p" : 9,
"nac_v" : 1,
"sil" : 3,
"sil_type" : "perhour",
"gva" : 2,
"sda" : 2,
"mlat" : [ ],
"tisb" : [ ],
"messages" : 876,
"seen" : 1.1,
"rssi" : -1.8,
"aircraft" : {
"icao24" : "a39fb1",
"registration" : "N33203",
"manufacturericao" : "BOEING",
"manufacturername" : "Boeing",
"model" : "737-824",
"typecode" : "B738",
"serialnumber" : 30613,
"linenumber" : null,
"icaoaircrafttype" : "L2J",
"operator" : null,
"operatorcallsign" : "UNITED",
"operatoricao" : "UAL",
"operatoriata" : null,
"owner" : "Wells Fargo Trust Co Na Trustee",
"testreg" : null,
"registered" : null,
"reguntil" : "2023-07-31",
"status" : null,
"built" : "2000-01-01",
"firstflightdate" : null,
"seatconfiguration" : null,
"engines" : "CFM INTL. CFM56 SERIES",
"modes" : false,
"adsb" : false,
"acars" : false,
"notes" : null,
"categoryDescription" : "No ADS-B Emitter Category Information"
}
}
... View more
10-17-2022
11:23 PM
@ChuckE that's it. Thanks for your support in this case. Now, it works fine.
... View more
10-13-2022
08:52 AM
Thanks @SAMSAL, I was tracking that previous post but since it was so old I was hoping newer versions of NiFi could address this. This is such a simple thing with XML and the EvaluateXPath processor, I am just surprised that we can't do something similar with JSON. Oh well, 2 processors it is.
... View more
10-08-2022
10:15 PM
1 Kudo
The ReplaceText procesor has a prepend/append mode which might be of help
... View more
10-06-2022
11:42 AM
Brilliant! That does the trick. Thanks!
... View more
- « Previous
-
- 1
- 2
- Next »