Member since
02-19-2016
8
Posts
5
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
8340 | 02-22-2016 08:18 PM |
05-09-2016
03:37 PM
Here is the flow where I have removed sensitive info (sorry for bad quality!!) Here are the processors AddHeader {"index":{"_index":"${name:toLower()}","_type":"${observableProperty}"}} {"observableProperty" MERGE ADJUST FORMAT IN BULK POST HTTP TO ES
... View more
05-09-2016
01:18 PM
This is what I did...................................I had a series of observation coming from a sensor...............something like: {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t1} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t2} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t3} ....................................................................................................... {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":tn} I have used a ReplaceText processor to transform the series in something which would fit the POST BULK ES API First, I have replaced {"attr1": with: {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1": thus getting the newly transformed series: {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t1}
{"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t2} .......................................................................................................... {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":tn} I have then merged the series with a MergeProcessor and got something like: {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t1}{"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t2}{"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t3}......................................................................{"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":tn} At this stage, a ReplaceText processor has helped me breaking the merged block into lines to be sent to ES. I have replaced }{"index" with } {"index" and got {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t1} {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t2} {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":t3} ...................................................................... {"index":{"_index":"{your_index_value}","_type":"attr1"}} {"attr1":"{value}","attr2":"{value}","attr3":"{value}","attr4":"{value}","timestamp":tn} Finally I have posted the series to ES via a PostHTTP processor with the following configuration: URL: http://{my-ip}:9200/_bulk sendAsFlowFile: false I tell you it is working. I hope it would help. Massimiliano
... View more
02-22-2016
08:18 PM
1 Kudo
I have solved by upgrading to version 0.5.0.
... View more
02-22-2016
08:17 PM
1 Kudo
It is like this from version 0.5.0.
... View more
02-21-2016
09:57 PM
1 Kudo
First of all, thank you for both answers. I am working with version 0.4. I have added a property "Content-Type" with a value of "application/json" and it is not worling.............should i keep the quotes? Regarding the secons answer...............do you mean I have to amend the mime.type attribute to "application/json"? If so, how? Thank you, Regards, Massimiliano
... View more
02-19-2016
07:48 PM
2 Kudos
I am using the InvokeHTTP processor. I need to post a json to a REST URL. I get the json via a GetFile processor, then manipulate it and finally route it to the InvokeHTTP processor. Well I get an error (412 HTTP code) because I am not able to specify teh content-type. How can I do it? Dynamic properties? Help please, Massimiliano
... View more