(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82107],{7719:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/log-management/security/opensearch-api-access",function(){return a(75466)}])},75466:function(e,s,a){"use strict";a.r(s),a.d(s,{__toc:function(){return r},default:function(){return h}});var n=a(85893),t=a(31379),c=a(9575),i={src:"/_next/static/media/elasticsearch-access.e1ec5c02.png",height:324,width:1147,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAMAAABSSm3fAAAACVBMVEXo7env8O/29vYKK69TAAAACXBIWXMAABcSAAAXEgFnn9JSAAAAF0lEQVR4nGNgYGBkZGRiYGBgYGRgADEAAGUACjWTSVIAAAAASUVORK5CYII=",blurWidth:8,blurHeight:2},o={src:"/_next/static/media/basic-authentication-mode.224fa9e5.png",height:528,width:2041,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAMAAABSSm3fAAAAD1BMVEXu8O7z8/Pq6urc5t76+fp1kLMZAAAACXBIWXMAABcSAAAXEgFnn9JSAAAAF0lEQVR4nGNgYmJkZGRhAAEmJgYWZmYAANkAGhh7ODwAAAAASUVORK5CYII=",blurWidth:8,blurHeight:2};let r=[{depth:3,value:"How to find your OpenSearch access details",id:"how-to-find-your-opensearch-access-details"},{depth:3,value:"Using API key authentication mode to access OpenSearch API",id:"using-api-key-authentication-mode-to-access-opensearch-api"},{depth:3,value:"Using basic authentication mode to access OpenSearch API",id:"using-basic-authentication-mode-to-access-opensearch-api"}];function l(e){let s=Object.assign({h1:"h1",p:"p",h3:"h3",ol:"ol",li:"li",img:"img",pre:"pre",code:"code",span:"span",em:"em"},(0,c.a)(),e.components);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h1,{children:"How to access my stack via the OpenSearch API?"}),"\n",(0,n.jsx)(s.p,{children:"Although we recommend using OpenSearch Dashboards to view the data in your stacks,\nyou can access your stacks using the OpenSearch API with your OpenSearch\naccess details. Logit.io offers two methods of accessing your OpenSearch API,\nbasic authentication mode and API key authentication mode."}),"\n",(0,n.jsx)(s.h3,{id:"how-to-find-your-opensearch-access-details",children:"How to find your OpenSearch access details"}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsx)(s.li,{children:"Login to your Logit.io account."}),"\n",(0,n.jsx)(s.li,{children:"Select Settings for the stack you wish to access."}),"\n",(0,n.jsx)(s.li,{children:"Choose OpenSearch Settings from the menu."}),"\n",(0,n.jsx)(s.li,{children:"Your OpenSearch access details are displayed."}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"using-api-key-authentication-mode-to-access-opensearch-api",children:"Using API key authentication mode to access OpenSearch API"}),"\n",(0,n.jsx)(s.p,{children:"This is the default method of accessing your OpenSearch API. The access\ndetails provide you with the information required to access your stack:"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Elasticsearch Access",placeholder:"blur",src:i})}),"\n",(0,n.jsx)(s.p,{children:"You can create your web request in the following format:"}),"\n",(0,n.jsx)(s.pre,{"data-language":"cmd","data-theme":"default",hasCopyCode:!0,children:(0,n.jsx)(s.code,{"data-language":"cmd","data-theme":"default",children:(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"[ELASTICSEARCHENDPOINT]/_search?apikey"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"[YOURAPIKEY]"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"&"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"pretty"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-constant)"},children:"true"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"&"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"q"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"[QUERY] "})]})})}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.em,{children:"Example CURL command:"})}),"\n",(0,n.jsx)(s.pre,{"data-language":"cmd","data-theme":"default",hasCopyCode:!0,children:(0,n.jsx)(s.code,{"data-language":"cmd","data-theme":"default",children:(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"curl "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"i "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"X"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" GET "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"https://e6db21bb-daa8-4f06-990f-46e54fc119f3-es.logit.io/_search?apikey=e5d65acc-972a-44c1-ad42-688dfca27a04ae&pretty=true&q=[QUERY]"'})]})})}),"\n",(0,n.jsx)(s.h3,{id:"using-basic-authentication-mode-to-access-opensearch-api",children:"Using basic authentication mode to access OpenSearch API"}),"\n",(0,n.jsx)(s.p,{children:"The OpenSearch access details provide you with the information required to access your stack:"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Basic Authentication Mode",placeholder:"blur",src:o})}),"\n",(0,n.jsx)(s.p,{children:"You will need to encode your username and password to base64encoding.\nA REST client can generate this for you using your credentials."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.em,{children:"Example CURL command:"})}),"\n",(0,n.jsx)(s.pre,{"data-language":"cmd","data-theme":"default",hasCopyCode:!0,children:(0,n.jsx)(s.code,{"data-language":"cmd","data-theme":"default",children:(0,n.jsxs)(s.span,{className:"line",children:[(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"curl "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"i "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:"-"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"X"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-keyword)"},children:" GET -"}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:"H "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"Authorization:Basic [BASE64ENCODEDCREDENTIALS]"'}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,n.jsx)(s.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"https:///e6db21bb-daa8-4f06-990f-46e54fc119f3-es.logit.io/_search?q=[QUERY]"'})]})})})]})}var h=(0,t.j)({MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:s}=Object.assign({},(0,c.a)(),e.components);return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(l,{...e})}):l(e)},pageOpts:{filePath:"src/pages/log-management/security/opensearch-api-access.mdx",route:"/log-management/security/opensearch-api-access",frontMatter:{title:"OpenSearch API Access",metaTitle:"Learn How to Access your Stack via OpenSearch API",description:"Discover the steps you need to take to access your Logit.io stack via the OpenSearch API in this helpful article from Logit.io."},title:"OpenSearch API Access",headings:r},pageNextRoute:"/log-management/security/opensearch-api-access"})}},function(e){e.O(0,[31379,92888,49774,40179],function(){return e(e.s=7719)}),_N_E=e.O()}]);