{"id":40958,"date":"2023-04-18T17:06:04","date_gmt":"2023-04-08T22:51:47","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/"},"modified":"2024-01-15T10:49:18","modified_gmt":"2024-01-15T02:49:18","slug":"%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/","title":{"rendered":"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service"},"content":{"rendered":"<h1>\u9996\u5148<\/h1>\n<p>\u6211\u53d1\u73b0\u4e86\u4e24\u79cd\u65b9\u6cd5\u6765\u5c06CloudTrail\u6295\u5165\u5230Elasticsearch Service\u4e2d\uff0c\u6240\u4ee5\u6211\u5c06\u5b83\u4eec\u4f5c\u4e3a\u5907\u5fd8\u5f55\u6574\u7406\u4e00\u4e0b\u3002<\/p>\n<h1>1. \u4e91\u8ddf\u8e2a\u2192S3\u2192Lambda\u2192Elasticsearch \u670d\u52a1<\/h1>\n<p>\u4f7f\u7528Lambda\u5904\u7406\u4ee5gz\u683c\u5f0f\u4fdd\u5b58\u5728S3\u4e2d\u7684\u6587\u4ef6\u5e76\u5c06\u5176\u6ce8\u518c\u5230Elasticsearch Service\u7684\u6a21\u5f0f\u3002<br \/>\n\u53ef\u4ee5\u901a\u8fc7\u641c\u7d22\u627e\u5230\u793a\u4f8b\u4ee3\u7801\uff0c\u4f46\u9700\u8981\u4ece\u5934\u5f00\u59cb\u521b\u5efaLambda\u51fd\u6570\u3002<\/p>\n<h2>NodeJS Lambda\u51fd\u6570\u521b\u5efa\u7684\u53c2\u8003\u8d44\u6599<\/h2>\n<p>S3\u4e0a\u7684Lambda\u793a\u4f8b\u5df2\u5728awslabs\u7684Github\u4e0a\u516c\u5f00\uff0c\u7528\u4e8e\u5c06\u6570\u636e\u6ce8\u518c\u5230Elasticsearch Service\u3002<br \/>\nhttps:\/\/github.com\/awslabs\/amazon-elasticsearch-lambda-samples\/blob\/master\/src\/s3_lambda_es.js<br \/>\n\u53ef\u4ee5\u6839\u636e\u4ee5\u4e0b\u7f51\u7ad9\u7684\u4ee3\u7801\u4f5c\u4e3a\u53c2\u8003\uff0c\u5728\u4e0a\u8ff0\u57fa\u7840\u4e0a\u89e3\u538bgz\u6587\u4ef6\u3002<br \/>\n\u4f7f\u7528Lambda\u5c06CloudTrail\u65e5\u5fd7\u5b58\u5165CloudSearch\u4ee5\u8fdb\u884c\u641c\u7d22\u3002<\/p>\n<h2>Lambda\u6267\u884c\u89d2\u8272\u7684\u914d\u7f6e\u3002<\/h2>\n<p>\u5982\u679cElasticsearch\u7684\u8bbf\u95ee\u7b56\u7565\u662f\u5b8c\u5168\u5f00\u653e\u7684\uff0c\u5c31\u4e0d\u9700\u8981\u592a\u5728\u610f\u3002\u4f46\u5982\u679c\u4f7f\u7528IAM\u6216IP\u8fdb\u884c\u9650\u5236\uff0c\u9700\u8981\u5728Lambda\u2192Elasticsearch API\u4e2d\u4f7f\u8bbf\u95ee\u6210\u4e3a\u53ef\u80fd\uff0c\u5c31\u9700\u8981\u5728Lambda\u6267\u884c\u89d2\u8272\u4e2d\u6388\u4e88es:*\u6216es:ESHttpPost\u7b49\u6743\u9650\u3002<br \/>\n\u203b\u5c1a\u672a\u7ecf\u9a8c\u8bc1\uff0c\u4f46\u7406\u8bba\u4e0a\u53ef\u4ee5\u5c06Lambda\u7684\u6267\u884c\u89d2\u8272\u6dfb\u52a0\u5230Elasticsearch Service\u7684\u8bbf\u95ee\u7b56\u7565\u4e2d\u4e5f\u53ef\u4ee5\u5427\uff1f<\/p>\n<p>\u8bf7\u53c2\u9605\u4ee5\u4e0b\u5173\u4e8e\u8bbf\u95ee\u7b56\u7565\u8bbe\u7f6e\u548c\u53ef\u4ee5\u5728\u64cd\u4f5c\u4e2d\u8bbe\u7f6e\u7684\u503c\u7684\u4fe1\u606f\u3002<br \/>\n\u521b\u5efa\u548c\u914d\u7f6e Amazon ES \u57df\u540d\u3002<\/p>\n<h1>2. \u4e91\u8db3\u8ff9\u2192\u4e91\u76d1\u63a7\u65e5\u5fd7\u2192Lambda\u2192Elasticsearch \u670d\u52a1<\/h1>\n<p>\u5c06CloudTrail\u7684\u65e5\u5fd7\u6ce8\u518c\u5230CloudWatch Logs\uff0c\u7136\u540e\u901a\u8fc7Lambda\u8fdb\u884c\u5904\u7406\uff0c\u5e76\u5c06\u5176\u6ce8\u518c\u5230Elasticsearch Service\u7684\u6a21\u5f0f\u3002<br \/>\n\u4ee5\u4e0b\u7f51\u7ad9\u6709\u6b65\u9aa4\uff0c\u4f46\u4e0e1.\u4e0d\u540c\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c4f\u5e55\u4e0a\u7684\u70b9\u51fb\u8bbe\u7f6e\u6765\u5b8c\u6210\u3002<br \/>\n\u3010\u8fd0\u8425\u3011\u5229\u7528\u901a\u8fc7CloudTrail\u83b7\u53d6\u7684\u5ba1\u8ba1\u65e5\u5fd7\u5728ElasticSearch Service\u4e2d\u3010\u7b80\u5355\u8bbe\u7f6e\u3011<br \/>\n\u975e\u5e38\u7b80\u5355\u53c8\u65b9\u4fbf\uff01\uff01<\/p>\n<p>\u6211\u8ba4\u4e3a\uff0c\u6700\u7ec8\u8fd8\u662f\u8981\u4f7f\u7528Lambda\uff0c\u6240\u4ee5\u6211\u5efa\u8bae\u60a8\u67e5\u770b\u6240\u521b\u5efa\u7684\u4ee3\u7801\u548c\u89d2\u8272\u8bbe\u7f6e\u3002<br \/>\n* \u8fd9\u91cc\u4f7f\u7528\u4e86Bulk API\u6765\u6ce8\u518c\u5230Elasticsearch\u3002<\/p>\n<h1>\u8003\u5bdf &#8211; \u7814\u7a76\u3001\u89c2\u5bdf<\/h1>\n<p>\u7531\u4e8e\u53ef\u4ee5\u8f7b\u677e\u5730\u4ece\u754c\u9762\u8bbe\u7f6e\uff0c\u56e0\u6b64\u5728\u7b2c\u4e8c\u79cd\u914d\u7f6e\u4e2d\u4f7f\u7528\u975e\u5e38\u7b80\u5355\u3002<br \/>\n\u7136\u800c\uff0c\u4ece\u8d39\u7528\u89d2\u5ea6\u6765\u770b\uff0c\u7b2c\u4e8c\u79cd\u914d\u7f6e\u540c\u65f6\u4fdd\u5b58\u5728S3\u548cCloudWatch Logs\u4e2d\uff0c\u6240\u4ee5\u611f\u89c9\u4f1a\u589e\u52a0\u4e00\u4e9b\u8d39\u7528\u3002<\/p>\n<h1>\u6292\u53d1\u4e00\u4e0b\u6211\u7684\u89c1\u89e3<\/h1>\n<p>\u542c\u8bf4\u6709\u4e00\u4e2a\u5173\u4e8eLambda\u652f\u6301\u7684\u8bed\u8a00\u7684\u8c03\u67e5\uff0c\u662f\u9009\u62e9Go\u8bed\u8a00\u8fd8\u662fRuby\u66f4\u597d\uff1f<br \/>\n\u6211\u89c9\u5f97Ruby\u66f4\u597d\u3002<\/p>\n<blockquote><p>\u6211\u4eec\u60f3\u542c\u542c\u60a8\u7684\u610f\u89c1 &#8211; \u60a8\u8ba4\u4e3a AWS Lambda \u5e94\u8be5\u652f\u6301\u4e0b\u4e00\u4e2a\u8bed\u8a00\u662f\u54ea\u79cd\uff1f#Golang \u8fd8\u662f #Ruby\uff1f\u2014 \u4e9a\u9a6c\u900a\u7f51\u7edc\u670d\u52a1\uff08@awscloud\uff092015\u5e7410\u670829\u65e5<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6211\u53d1\u73b0\u4e86\u4e24\u79cd\u65b9\u6cd5\u6765\u5c06CloudTrail\u6295\u5165\u5230Elasticsearch Service\u4e2d\uff0c\u6240\u4ee5\u6211\u5c06\u5b83\u4eec [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-40958","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06cloudtrail\u65e5\u5fd7\u53d1\u9001\u5230elasticsearch-service\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 \u6211\u53d1\u73b0\u4e86\u4e24\u79cd\u65b9\u6cd5\u6765\u5c06CloudTrail\u6295\u5165\u5230Elasticsearch Service\u4e2d\uff0c\u6240\u4ee5\u6211\u5c06\u5b83\u4eec [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06cloudtrail\u65e5\u5fd7\u53d1\u9001\u5230elasticsearch-service\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-08T22:51:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T02:49:18+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/\",\"name\":\"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-04-08T22:51:47+00:00\",\"dateModified\":\"2024-01-15T02:49:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06cloudtrail\u65e5\u5fd7\u53d1\u9001\u5230elasticsearch-service\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service","og_description":"\u9996\u5148 \u6211\u53d1\u73b0\u4e86\u4e24\u79cd\u65b9\u6cd5\u6765\u5c06CloudTrail\u6295\u5165\u5230Elasticsearch Service\u4e2d\uff0c\u6240\u4ee5\u6211\u5c06\u5b83\u4eec [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5c06cloudtrail\u65e5\u5fd7\u53d1\u9001\u5230elasticsearch-service\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-04-08T22:51:47+00:00","article_modified_time":"2024-01-15T02:49:18+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/","name":"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-04-08T22:51:47+00:00","dateModified":"2024-01-15T02:49:18+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5c06CloudTrail\u65e5\u5fd7\u53d1\u9001\u5230Elasticsearch Service"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%b0%86cloudtrail%e6%97%a5%e5%bf%97%e5%8f%91%e9%80%81%e5%88%b0elasticsearch-service%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=40958"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40958\/revisions"}],"predecessor-version":[{"id":58772,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/40958\/revisions\/58772"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=40958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=40958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=40958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}