Hey there.
Trying to pull data from a device which supports http protocol and has the option to query for
different parameters in JSON-Format. Because the device puts the data in an array i have json.is_array enabled.
Because as far as I'm concerned you will not be able to work with that document because the values are arrays of different types. In ES you can easily push an array for the value of a field like that:
{"field1": ["V","W"], "field2": [1,2] }
But they(values in the array) have to be of the same type, as above, where in your case they are arrays containing values of different types. I do recommend you make your own tests, maybe there is a combination of settings to make ES accept the first value of the array and then refuse the second one... but ignore the error on the bad type of the second one and still index the document? Not sure, I have never tried to index such array of differing types(because it doesn't work).
If that is indeed a dead end because of the types in the arrays the next step would depend on where it is easier for you to intervene in a custom manner... One option is to ship this into an ingest pipeline like this: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/script-processor.html
Where possibilities are infinite*(TM). And fix the problem there.
Hi Martin,
thanks alot for the information.
Yeah i tried pushing the data without the json.is_array-setting.
when using the same settings as above, i cant see any data output to elastic/kibana.
I think because these types of array doesnt work, as you mentioned.
I also tried pushing only one parameter but this doesn't work aswell.
I should get this array: { "_P_SUM3": [413.7307,"W"],
But this is what the http-module push to elastic.
Im not sure how the http module parse the data. As you can see the Parameter "_P_SUM3" says ""var not found !", this is the message you get from the device when the parameter name is wrong. I was wondering where the equal sign in _P_SUM3= in the doc comes from.
I will give the script processor a try.
If anyone else has a suggestion too, I would be very grateful.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.