Member since
12-25-2018
13
Posts
0
Kudos Received
0
Solutions
07-18-2019
08:28 PM
Hi, I have a NiFi instance running on a Docker container and, and I'd like to get some information about it through its API. To do so, I have followed the steps indicated here: https://community.hortonworks.com/questions/96383/how-to-get-the-access-token-by-invoking-nifi-rest.html, using this command: curl 'http://<my_nifi_ip>:<my_nifi_port>/nifi/nifi-api/access/token' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'username=<my_user>&password=<my_password>' --compressed But, when launching this command, it redirects me to the login page of NiFi <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href="/login.html">here</a>.</p> </body></html> How can I solve my problem to get the token? Thank you for your help. Regards.
... View more
Labels:
- Labels:
-
Apache NiFi
06-24-2019
05:31 PM
Hi, I'd like to obtain a token that allow me to perform certain read operations over a secured NiFi instance. To achieve so, I'm executing: curl 'http://<ip_nifi>:<port_nifi>/nifi-api/access/token' -H 'Accept-Encoding: gzip, deflate,br' -H 'Content-Type:application/x-www-form-urlencoded;charset=UTF-8' -H 'Accept: */*' --data 'username=<my_username>&password=<my_password>' --compressed But I'm having no success. In fact, when I execute this command, the message returned is: <!DOCTYPE html> <html lang="es" > <meta charset="UTF-8"> <head> <title>NIFI</title> <link rel="stylesheet" href="pcss/style.css"> </head> <body> <video autoplay muted loop id="video"> <source src="pvideo/background.webm" type="video/mp4"> Tu navegador no soporta video HTML5. </video> <div class="content"> <div class="login"> <div class="logo"></div> <form method="post" action="/login"> <input type="text" placeholder="User" required="required" name="httpd_username" /> <input type="password" placeholder="Password" required="required" name="httpd_password" /> <input type="hidden" name="httpd_location" value="/nifi" /> <input class="submit" type="submit" class="btn btn-primary btn-block btn-large" value="Iniciar Sesión" /> </form> </div> </div> </body> </html> Which is, in fact, the HTML code of the login screen. How could I obtain the token instead of this message? Thanks for your help.
... View more
Labels:
- Labels:
-
Apache NiFi
05-12-2019
10:30 AM
Hi, I'd like to know if is it possible to insert a whole JSON (incoming flowfile) to a specific column in a Cassandra table. This column is a text-type column, so the JSON would have to be inserted as a String. Which processors should I use to achieve my objective? I've tried with PutCassandraRecord but it didn't work. Many thanks for your attention.
... View more
Labels:
- Labels:
-
Apache NiFi
04-27-2019
10:10 AM
Any help with this? Regards
... View more
04-25-2019
08:11 AM
Hi, I am trying to introduce a register_date field to a Cassandra table from NiFi. To do so, I have to follow this process: catch an event, take a field from the JSON generated for that event (the field date), and transform it to date format so Cassandra table can include it as a date field. I'm following the next structure: First of all, I'm listening from some events. That's the reason why I'm using ListenHTTP processor. Then I take some fields from the JSON I receive and take a specific field to check if it meets a certain condition. If that's correct, I route the JSON and, again, take some fields of the JSON (second EvaluateJsonPath processor). I build a new JSON with elements taken from the previous processor. Then, I use UpdateRecord processor to update register_date field. Given that, in Cassandra, this field is of date type, I have to transform it to give it a date format. This is my configuration of that processor: When I trigger the event that actives the flow, all goes fine until UpdateRecord processor, where I find this error: "cannot write schema name as attribute because the schema name is not known". Can you help me? What am I doing wrong? Many thanks for your help. Regards.
... View more
Labels:
- Labels:
-
Apache NiFi
04-24-2019
05:36 PM
Hi @Matt Burgess, I have deleted the "AttributeToJSON" processor I indicated you and now PutCassandraRecord processor doesn't return any error, so this problem has disappeared. Without it, anyway, and setting only this structure: In AttributesToJson I take the field register_date (which is null until that date), because this is the only field I want to put in the database. Then, with UpdateAttribute, I configure register_date as ${now():toNumber()} . At last, I use PutCassandraRecord. I'm obtaining in my database the following record: -294294420. What does this number mean? What if I want to obtain the date in a format of "yyyy-MM-dd", which is the format I was expecting to see? However, I do not understand very well the solution you are proposing (English is not my first language so it will possibly has something to do with that). Which is the structure you are proposing me, and how could I configure the UpdateRecord Processor, to achieve the objective that I have proposed in the previous paragraph? Many thanks for your help.
... View more
04-24-2019
03:51 PM
The error I'm obtaining now is "Expected 4 byte long for date (13)".
... View more
04-24-2019
03:44 PM
Hi @Matt Burgess. Thanks for your response, but it is still failing :(. My three blocks are: UpdateAttribute, to give to register_date the value you have indicate, AttributestoJSON and, at last, PutCassandraRecord. Am I doing anything wrong? Thanks for your attention.
... View more
04-24-2019
09:38 AM
Hi, I have a Cassandra table where one of its fields is "register_date", which is a date type field. I'm facing several problems to insert this date in Cassandra from NiFi. I'm using UpdateAttribute processor to generate the field, with this content: ${now():format("yyyyMMdd")} When the flow file arrives to PutCassandraRecord processor I get the following error: "Expected 4 byte long for date". What am I doing wrong? Thanks for your help 🙂
... View more
Labels:
- Labels:
-
Apache NiFi
03-24-2019
07:13 PM
Hi, I'm a newbie un NiFi world and I'm interested on doing some operations with this tool. I have a JSON file with some fields (Id, Name, Country, time), and I'd like to generate another JSON with only the fields I'm interested in: Id and Name, to load it later on a Casandra DB table. How can I achieve this? Any help wil be very appreciated 🙂
... View more
Labels:
- Labels:
-
Apache NiFi
12-26-2018
02:16 AM
Hi, I've a table countries with the following structure: CREATE TABLE countries(
id INT,
code CHAR(2),
name STRING,
continent CHAR(2),
wikipedia_link STRING,
keywords STRING)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','; My objective is deleting the wikipedia_link column with the following command: ALTER TABLE countries DROP COLUMN wikipedia_link But, when viewing the contents of the table, I realise that, now, the column keywords contains the wikipedia links for each country, instead of the values of the keyword for each country. It seems that only the column is being removed, but not the content of it -my objective is removing both- . To sum up: only the header is being removed, and the following one (keywords) is being shifted to the left. I've tried, too, altering the columns of the table with this command: ALTER TABLE countries REPLACE COLUMNS (
id INT,
code CHAR(2),
name STRING,
continent CHAR(2),
keywords STRING)
But the result is the same: I'm still seeing the values of wikipedia link for each country in the column "keywords". Any idea on how to solve this problem? Regards!
... View more
Labels:
- Labels:
-
Apache Hive