mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-10-14 05:36:13 +00:00
26 lines
30 KiB
HTML
26 lines
30 KiB
HTML
<!doctype html>
|
||
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-2.0-2.4 plugin-docs plugin-id-default docs-doc-id-pages-for-subheaders/cluster-logging">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="generator" content="Docusaurus v2.3.1">
|
||
<title data-rh="true">Cluster Logging | Rancher</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://ranchermanager.docs.rancher.com/v2.0-v2.4/pages-for-subheaders/cluster-logging"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="2.0-2.4"><meta data-rh="true" name="docusaurus_tag" content="docs-default-2.0-2.4"><meta data-rh="true" name="docsearch:version" content="2.0-2.4"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-2.0-2.4"><meta data-rh="true" property="og:title" content="Cluster Logging | Rancher"><meta data-rh="true" name="description" content="Rancher integrates with popular logging services. Learn the requirements and benefits of integrating with logging services, and enable logging on your cluster."><meta data-rh="true" property="og:description" content="Rancher integrates with popular logging services. Learn the requirements and benefits of integrating with logging services, and enable logging on your cluster."><link data-rh="true" rel="icon" href="/img/favicon.png"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/v2.0-v2.4/pages-for-subheaders/cluster-logging" hreflang="en"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/zh/v2.0-v2.4/pages-for-subheaders/cluster-logging" hreflang="zh"><link data-rh="true" rel="alternate" href="https://ranchermanager.docs.rancher.com/v2.0-v2.4/pages-for-subheaders/cluster-logging" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://30NEY6C9UY-dsn.algolia.net" crossorigin="anonymous"><link data-rh="true" rel="canonical" href="https://ranchermanager.docs.rancher.com/pages-for-subheaders/logging"><link rel="preconnect" href="https://www.googletagmanager.com">
|
||
<script>window.dataLayer=window.dataLayer||[]</script>
|
||
<script>!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id=GTM-57KS2MW",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")</script>
|
||
|
||
|
||
<link rel="search" type="application/opensearchdescription+xml" title="Rancher" href="/opensearch.xml">
|
||
|
||
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" charset="UTF-8" data-domain-script="0f98beb0-fc4c-417d-a42e-564e2cae42d2" async></script>
|
||
<script src="/scripts/optanonwrapper.js" async></script><link rel="stylesheet" href="/assets/css/styles.efd70281.css">
|
||
<link rel="preload" href="/assets/js/runtime~main.5e8050ed.js" as="script">
|
||
<link rel="preload" href="/assets/js/main.7c8ccb50.js" as="script">
|
||
</head>
|
||
<body class="navigation-with-keyboard">
|
||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-57KS2MW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||
|
||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}()</script><div id="__docusaurus">
|
||
<div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/rancher-logo-horiz-color.svg" alt="logo" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/rancher-logo-horiz-color.svg" alt="logo" class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate"></b></a><div class="navbar__item dropdown dropdown--hoverable"><a aria-current="page" class="navbar__link active" aria-haspopup="true" aria-expanded="false" role="button" href="/v2.0-v2.4">v2.0-v2.4</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/">Latest</a></li><li><a class="dropdown__link" href="/v2.7">v2.7</a></li><li><a class="dropdown__link" href="/v2.6">v2.6</a></li><li><a class="dropdown__link" href="/v2.5">v2.5</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/v2.0-v2.4/pages-for-subheaders/cluster-logging">v2.0-v2.4</a></li><li><a class="dropdown__link" href="/versions">All versions</a></li></ul></div></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_nlXk"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>English</a><ul class="dropdown__menu"><li><a href="/v2.0-v2.4/pages-for-subheaders/cluster-logging" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="en">English</a></li><li><a href="/zh/v2.0-v2.4/pages-for-subheaders/cluster-logging" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="zh">简体中文</a></li></ul></div><a href="https://github.com/rancher/rancher-docs" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link navbar__github">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a href="https://www.rancher.com" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Rancher Home<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="searchBox_ZlJk"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/v2.0-v2.4">Rancher 2.0-2.4</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/v2.0-v2.4/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/v2.0-v2.4/how-to-guides">How-to Guides</a><button aria-label="Toggle the collapsible sidebar category 'How-to Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/v2.0-v2.4/reference-guides">Reference Guides</a><button aria-label="Toggle the collapsible sidebar category 'Reference Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/v2.0-v2.4/explanations">Explanations</a><button aria-label="Toggle the collapsible sidebar category 'Explanations'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/v2.0-v2.4/pages-for-subheaders/integrations-in-rancher">Integrations in Rancher</a><button aria-label="Toggle the collapsible sidebar category 'Integrations in Rancher'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/v2.0-v2.4/pages-for-subheaders/cis-scans">CIS Scans</a><button aria-label="Toggle the collapsible sidebar category 'CIS Scans'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/v2.0-v2.4/pages-for-subheaders/istio">Istio</a><button aria-label="Toggle the collapsible sidebar category 'Istio'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" tabindex="0" href="/v2.0-v2.4/pages-for-subheaders/cluster-logging">Logging</a><button aria-label="Toggle the collapsible sidebar category 'Logging'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/elasticsearch">Elasticsearch</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/fluentd">Fluentd</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/kafka">Kafka</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/splunk">Splunk</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/syslog">Syslog</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/v2.0-v2.4/pages-for-subheaders/cluster-alerts">Alerting</a><button aria-label="Toggle the collapsible sidebar category 'Alerting'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/v2.0-v2.4/pages-for-subheaders/cluster-monitoring">Monitoring</a><button aria-label="Toggle the collapsible sidebar category 'Monitoring'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/opa-gatekeeper">OPA Gatekeeper</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/v2.0-v2.4/explanations/integrations-in-rancher/notifiers">Notifiers</a></li></ul></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/v2.0-v2.4/faq">FAQ</a><button aria-label="Toggle the collapsible sidebar category 'FAQ'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/v2.0-v2.4/troubleshooting">Troubleshooting</a><button aria-label="Toggle the collapsible sidebar category 'Troubleshooting'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/v2.0-v2.4/contribute-to-rancher">Contributing to Rancher</a></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="theme-doc-version-banner alert alert--warning margin-bottom--md" role="alert"><div>This is documentation for <!-- -->Rancher<!-- --> <b>v2.0-v2.4</b>, which is no longer actively maintained.</div><div class="margin-top--md">For up-to-date documentation, see the <b><a href="/">latest version</a></b> (<!-- -->Latest<!-- -->).</div></div><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/v2.0-v2.4/explanations"><span itemprop="name">Explanations</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/v2.0-v2.4/pages-for-subheaders/integrations-in-rancher"><span itemprop="name">Integrations in Rancher</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Logging</span><meta itemprop="position" content="3"></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">Version: v2.0-v2.4</span><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Cluster Logging</h1></header><p>Logging is helpful because it allows you to:</p><ul><li>Capture and analyze the state of your cluster</li><li>Look for trends in your environment</li><li>Save your logs to a safe location outside of your cluster</li><li>Stay informed of events like a container crashing, a pod eviction, or a node dying</li><li>More easily debug and troubleshoot problems</li></ul><p>Rancher supports integration with the following services:</p><ul><li>Elasticsearch</li><li>Splunk</li><li>Kafka</li><li>Syslog</li><li>Fluentd</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-logging-integrations-work">How Logging Integrations Work<a href="#how-logging-integrations-work" class="hash-link" aria-label="Direct link to How Logging Integrations Work" title="Direct link to How Logging Integrations Work"></a></h2><p>Rancher can integrate with popular external services used for event streams, telemetry, or search. These services can log errors and warnings in your Kubernetes infrastructure to a stream.</p><p>These services collect container log events, which are saved to the <code>/var/log/containers</code> directory on each of your nodes. The service collects both standard and error events. You can then log into your services to review the events collected, leveraging each service's unique features.</p><p>When configuring Rancher to integrate with these services, you'll have to point Rancher toward the service's endpoint and provide authentication information.</p><p>Additionally, you'll have the opportunity to enter key-value pairs to filter the log events collected. The service will only collect events for containers marked with your configured key-value pairs.</p><blockquote><p><strong>Note:</strong> You can only configure one logging service per cluster or per project.</p></blockquote><h2 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements"></a></h2><p>The Docker daemon on each node in the cluster should be <a href="https://docs.docker.com/config/containers/logging/configure/" target="_blank" rel="noopener noreferrer">configured</a> with the (default) log-driver: <code>json-file</code>. You can check the log-driver by running the following command:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">$ docker info | grep 'Logging Driver'</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Logging Driver: json-file</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="logging-scope">Logging Scope<a href="#logging-scope" class="hash-link" aria-label="Direct link to Logging Scope" title="Direct link to Logging Scope"></a></h2><p>You can configure logging at either cluster level or project level.</p><ul><li>Cluster logging writes logs for every pod in the cluster, i.e. in all the projects. For <a href="/v2.0-v2.4/pages-for-subheaders/launch-kubernetes-with-rancher">RKE clusters</a>, it also writes logs for all the Kubernetes system components.</li><li><a href="/v2.0-v2.4/reference-guides/rancher-project-tools/project-logging">Project logging</a> writes logs for every pod in that particular project.</li></ul><p>Logs that are sent to your logging service are from the following locations:</p><ul><li>Pod logs stored at <code>/var/log/containers</code>.</li><li>Kubernetes system components logs stored at <code>/var/lib/rancher/rke/log/</code>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="enabling-cluster-logging">Enabling Cluster Logging<a href="#enabling-cluster-logging" class="hash-link" aria-label="Direct link to Enabling Cluster Logging" title="Direct link to Enabling Cluster Logging"></a></h2><p>As an <a href="/v2.0-v2.4/how-to-guides/advanced-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/global-permissions">administrator</a> or <a href="/v2.0-v2.4/how-to-guides/advanced-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/cluster-and-project-roles#cluster-roles">cluster owner</a>, you can configure Rancher to send Kubernetes logs to a logging service.</p><ol><li><p>From the <strong>Global</strong> view, navigate to the cluster that you want to configure cluster logging.</p></li><li><p>Select <strong>Tools > Logging</strong> in the navigation bar.</p></li><li><p>Select a logging service and enter the configuration. Refer to the specific service for detailed configuration. Rancher supports integration with the following services:</p><ul><li><a href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/elasticsearch">Elasticsearch</a></li><li><a href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/splunk">Splunk</a></li><li><a href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/kafka">Kafka</a></li><li><a href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/syslog">Syslog</a></li><li><a href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/fluentd">Fluentd</a></li></ul></li><li><p>(Optional) Instead of using the UI to configure the logging services, you can enter custom advanced configurations by clicking on <strong>Edit as File</strong>, which is located above the logging targets. This link is only visible after you select a logging service.</p><ul><li><p>With the file editor, enter raw fluentd configuration for any logging service. Refer to the documentation for each logging service on how to setup the output configuration.</p><ul><li><a href="https://github.com/uken/fluent-plugin-elasticsearch" target="_blank" rel="noopener noreferrer">Elasticsearch Documentation</a></li><li><a href="https://github.com/fluent/fluent-plugin-splunk" target="_blank" rel="noopener noreferrer">Splunk Documentation</a></li><li><a href="https://github.com/fluent/fluent-plugin-kafka" target="_blank" rel="noopener noreferrer">Kafka Documentation</a></li><li><a href="https://github.com/dlackty/fluent-plugin-remote_syslog" target="_blank" rel="noopener noreferrer">Syslog Documentation</a></li><li><a href="https://docs.fluentd.org/v1.0/articles/out_forward" target="_blank" rel="noopener noreferrer">Fluentd Documentation</a></li></ul></li><li><p>If the logging service is using TLS, you also need to complete the <strong>SSL Configuration</strong> form.</p><ol><li><p>Provide the <strong>Client Private Key</strong> and <strong>Client Certificate</strong>. You can either copy and paste them or upload them by using the <strong>Read from a file</strong> button.</p><ul><li><p>You can use either a self-signed certificate or one provided by a certificate authority.</p></li><li><p>You can generate a self-signed certificate using an openssl command. For example:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul></li><li><p>If you are using a self-signed certificate, provide the <strong>CA Certificate PEM</strong>.</p></li></ol></li></ul></li><li><p>(Optional) Complete the <strong>Additional Logging Configuration</strong> form.</p><ol><li><p><strong>Optional:</strong> Use the <strong>Add Field</strong> button to add custom log fields to your logging configuration. These fields are key value pairs (such as <code>foo=bar</code>) that you can use to filter the logs from another system.</p></li><li><p>Enter a <strong>Flush Interval</strong>. This value determines how often <a href="https://www.fluentd.org/" target="_blank" rel="noopener noreferrer">Fluentd</a> flushes data to the logging server. Intervals are measured in seconds.</p></li><li><p><strong>Include System Log</strong>. The logs from pods in system project and RKE components will be sent to the target. Uncheck it to exclude the system logs.</p></li></ol></li><li><p>Click <strong>Test</strong>. Rancher sends a test log to the service.</p><blockquote><p><strong>Note:</strong> This button is replaced with <em>Dry Run</em> if you are using the custom configuration editor. In this case, Rancher calls the fluentd dry run command to validate the configuration.</p></blockquote></li><li><p>Click <strong>Save</strong>.</p></li></ol><p><strong>Result:</strong> Rancher is now configured to send logs to the selected service. Log into the logging service so that you can start viewing the logs.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-links">Related Links<a href="#related-links" class="hash-link" aria-label="Direct link to Related Links" title="Direct link to Related Links"></a></h2><p><a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/" target="_blank" rel="noopener noreferrer">Logging Architecture</a></p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.0-2.4/pages-for-subheaders/cluster-logging.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"><span class="theme-last-updated">Last updated<!-- --> on <b><time datetime="2023-08-15T21:26:32.000Z">Aug 15, 2023</time></b></span></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/v2.0-v2.4/explanations/integrations-in-rancher/istio/release-notes"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Release Notes</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/v2.0-v2.4/explanations/integrations-in-rancher/cluster-logging/elasticsearch"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Elasticsearch</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#how-logging-integrations-work" class="table-of-contents__link toc-highlight">How Logging Integrations Work</a></li><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#logging-scope" class="table-of-contents__link toc-highlight">Logging Scope</a></li><li><a href="#enabling-cluster-logging" class="table-of-contents__link toc-highlight">Enabling Cluster Logging</a></li><li><a href="#related-links" class="table-of-contents__link toc-highlight">Related Links</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2023 SUSE Rancher. All Rights Reserved.</div></div></div></footer></div>
|
||
<script src="/assets/js/runtime~main.5e8050ed.js"></script>
|
||
<script src="/assets/js/main.7c8ccb50.js"></script>
|
||
</body>
|
||
</html> |