mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-11-09 10:19:16 +00:00
1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
"use strict";(self.webpackChunkrancher_docs=self.webpackChunkrancher_docs||[]).push([[69775],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>g});var r=n(67294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},k=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),k=s(n),g=a,d=k["".concat(p,".").concat(g)]||k[g]||c[g]||o;return n?r.createElement(d,i(i({ref:t},u),{},{components:n})):r.createElement(d,i({ref:t},u))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=k;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var s=2;s<o;s++)i[s]=n[s];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}k.displayName="MDXCreateElement"},98533:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>i,default:()=>c,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var r=n(87462),a=(n(67294),n(3905));const o={title:"Splunk"},i=void 0,l={unversionedId:"explanations/integrations-in-rancher/cluster-logging/splunk",id:"version-2.0-2.4/explanations/integrations-in-rancher/cluster-logging/splunk",title:"Splunk",description:"If your organization uses Splunk, you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Splunk server to view logs.",source:"@site/versioned_docs/version-2.0-2.4/explanations/integrations-in-rancher/cluster-logging/splunk.md",sourceDirName:"explanations/integrations-in-rancher/cluster-logging",slug:"/explanations/integrations-in-rancher/cluster-logging/splunk",permalink:"/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/splunk",draft:!1,editUrl:"https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.0-2.4/explanations/integrations-in-rancher/cluster-logging/splunk.md",tags:[],version:"2.0-2.4",lastUpdatedAt:1663953084,formattedLastUpdatedAt:"Sep 23, 2022",frontMatter:{title:"Splunk"},sidebar:"tutorialSidebar",previous:{title:"Kafka",permalink:"/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/kafka"},next:{title:"Syslog",permalink:"/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/syslog"}},p={},s=[{value:"Splunk Configuration",id:"splunk-configuration",level:2},{value:"SSL Configuration",id:"ssl-configuration",level:2},{value:"Viewing Logs",id:"viewing-logs",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}],u={toc:s};function c(e){let{components:t,...o}=e;return(0,a.kt)("wrapper",(0,r.Z)({},u,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"If your organization uses ",(0,a.kt)("a",{parentName:"p",href:"https://www.splunk.com/"},"Splunk"),", you can configure Rancher to send it Kubernetes logs. Afterwards, you can log into your Splunk server to view logs."),(0,a.kt)("blockquote",null,(0,a.kt)("p",{parentName:"blockquote"},(0,a.kt)("strong",{parentName:"p"},"Prerequisites:")),(0,a.kt)("ul",{parentName:"blockquote"},(0,a.kt)("li",{parentName:"ul"},"Configure HTTP event collection for your Splunk Server (Splunk Enterprise or Splunk Cloud)."),(0,a.kt)("li",{parentName:"ul"},"Either create a new token or copy an existing token.")),(0,a.kt)("p",{parentName:"blockquote"},"For more information, see ",(0,a.kt)("a",{parentName:"p",href:"http://docs.splunk.com/Documentation/Splunk/7.1.2/Data/UsetheHTTPEventCollector#About_Event_Collector_tokens"},"Splunk Documentation"),".")),(0,a.kt)("h2",{id:"splunk-configuration"},"Splunk Configuration"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"In the ",(0,a.kt)("strong",{parentName:"p"},"Endpoint")," field, enter the IP address and port for you Splunk instance (i.e. ",(0,a.kt)("inlineCode",{parentName:"p"},"http://splunk-server:8088"),")"),(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"Splunk usually uses port ",(0,a.kt)("inlineCode",{parentName:"li"},"8088"),". If you're using Splunk Cloud, you'll need to work with ",(0,a.kt)("a",{parentName:"li",href:"https://www.splunk.com/en_us/support-and-services.html"},"Splunk support")," to get an endpoint URL."))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Enter the ",(0,a.kt)("strong",{parentName:"p"},"Token")," you obtained while completing the prerequisites (i.e., when you created a token in Splunk).")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"In the ",(0,a.kt)("strong",{parentName:"p"},"Source")," field, enter the name of the token as entered in Splunk.")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},(0,a.kt)("strong",{parentName:"p"},"Optional:")," Provide one or more ",(0,a.kt)("a",{parentName:"p",href:"http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Aboutindexesandindexers"},"index")," that's allowed for your token."))),(0,a.kt)("h2",{id:"ssl-configuration"},"SSL Configuration"),(0,a.kt)("p",null,"If your instance of Splunk uses SSL, your ",(0,a.kt)("strong",{parentName:"p"},"Endpoint")," will need to begin with ",(0,a.kt)("inlineCode",{parentName:"p"},"https://"),". With the correct endpoint, the ",(0,a.kt)("strong",{parentName:"p"},"SSL Configuration")," form is enabled and ready to be completed."),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Provide the ",(0,a.kt)("strong",{parentName:"p"},"Client Private Key")," and ",(0,a.kt)("strong",{parentName:"p"},"Client Certificate"),". You can either copy and paste them or upload them by using the ",(0,a.kt)("strong",{parentName:"p"},"Read from a file")," button."),(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("p",{parentName:"li"},"You can use either a self-signed certificate or one provided by a certificate authority.")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("p",{parentName:"li"},"You can generate a self-signed certificate using an openssl command. For example:"),(0,a.kt)("pre",{parentName:"li"},(0,a.kt)("code",{parentName:"pre"},'openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com"\n'))))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Enter your ",(0,a.kt)("strong",{parentName:"p"},"Client Key Password"),".")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Select whether or not you want to verify your SSL."),(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"If you are using a self-signed certificate, select ",(0,a.kt)("strong",{parentName:"li"},"Enabled - Input trusted server certificate"),", provide the ",(0,a.kt)("strong",{parentName:"li"},"CA Certificate PEM"),". You can copy and paste the certificate or upload it using the ",(0,a.kt)("strong",{parentName:"li"},"Read from a file")," button."),(0,a.kt)("li",{parentName:"ul"},"If you are using a certificate from a certificate authority, select ",(0,a.kt)("strong",{parentName:"li"},"Enabled - Input trusted server certificate"),". You do not need to provide a ",(0,a.kt)("strong",{parentName:"li"},"CA Certificate PEM"),".")))),(0,a.kt)("h2",{id:"viewing-logs"},"Viewing Logs"),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Log into your Splunk server.")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Click on ",(0,a.kt)("strong",{parentName:"p"},"Search & Reporting"),". The number of ",(0,a.kt)("strong",{parentName:"p"},"Indexed Events")," listed should be increasing.")),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"Click on Data Summary and select the Sources tab.\n",(0,a.kt)("img",{alt:"View Logs",src:n(21292).Z,width:"796",height:"185"}))),(0,a.kt)("li",{parentName:"ol"},(0,a.kt)("p",{parentName:"li"},"To view the actual logs, click on the source that you declared earlier.\n",(0,a.kt)("img",{alt:"View Logs",src:n(81531).Z,width:"1246",height:"891"})))),(0,a.kt)("h2",{id:"troubleshooting"},"Troubleshooting"),(0,a.kt)("p",null,"You can use curl to see if ",(0,a.kt)("strong",{parentName:"p"},"HEC")," is listening for HTTP event data."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre"},"$ curl http://splunk-server:8088/services/collector/event \\\n -H 'Authorization: Splunk 8da70994-b1b0-4a79-b154-bfaae8f93432' \\\n -d '{\"event\": \"hello world\"}'\n")),(0,a.kt)("p",null,"If Splunk is configured correctly, you should receive ",(0,a.kt)("strong",{parentName:"p"},"json")," data returning ",(0,a.kt)("inlineCode",{parentName:"p"},"success code 0"),". You should be able\nto send logging data to HEC."),(0,a.kt)("p",null,"If you received an error, check your configuration in Splunk and Rancher."))}c.isMDXComponent=!0},21292:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/splunk4-a4b0b1ac0091808af1b5f24c111d944f.jpg"},81531:(e,t,n)=>{n.d(t,{Z:()=>r});const r=n.p+"assets/images/splunk5-d27f8ece5e6362fb1d226edaa930b288.jpg"}}]); |