How can I read data from a list and index specific values into Elasticsearch, using python?

后端 未结 1 649
温柔的废话
温柔的废话 2020-12-22 05:58

I have used "paramiko" to connect from my PC to a devboard, and execute a script. Then I am saving the results of this script in a list (output). I want to extract

1条回答
  •  粉色の甜心
    2020-12-22 06:18

    1. Remove the line breaks
    2. Split the text by a common delimiter (----INFERENCE TIME---- would be a good start I think)
    3. Extract the keys & values using for example r'(\w+:)\s(.*)' or a named lookbehind such as r'(?<=Note: ).*' etc
    4. Parse the numeric values (time, score, temperature, ...) -- you'll thank me later ;)
    5. Extend the Model mapping w/ a keyword datatype -- otherwise the dot will be tokenized away and you'll wonder why you can't search for exact matches nor aggregate on it
    6. Prepare the objects that you'll want to sync
    7. Bulk upload to ElasticSearch

    0 讨论(0)
提交回复
热议问题