Python stores data to Elasticsearch and then graphically analyzes it via Kinaba

Source: Internet
Author: User

Es = Elasticsearch (hosts=[{'Host':"elb-elasticsearch.cn-north-1.elb.amazonaws.com.cn",'Port':"9200"}],http_auth=("username","Password")) T= Datetime.fromtimestamp (int (1529986664), Pytz.timezone ('Asia/shanghai'))Print(t) data= { " Region":"cn","Env":"Dev","Product":"Reliability","Service":"DevOps","ObjectType":"EC2","Endpoint":"cn-dev-reliability-devops-ec2-172.31.116.5","Metric":"tcp_syn_sent","value": 800,
"timestamp": T, "BeginTime": T,"StartTime": 0,"Endtime": 0,"Step": 60,"CounterType":"COUNTER","Tag":"{aaa==1,bbb=2}","DataSource":"Transfer","kinesis":"true"} es.index (Index="kinesis-2015.06.26", doc_type="testdata", Body=data)


Comments:
"timestamp": T, incoming time parameters do not format the time, otherwise it will be an error, perhaps with my elk time stamp configuration, if you encounter similar problems can be noted under.


Python stores data to Elasticsearch and then graphically analyzes it via Kinaba

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.