Answers: <p>There are many products that will ship Kubernetes logs off to a central log server. The kubernetes documentation has <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/" rel="nofollow noreferrer">a section on logging</a> that is a good place to start.</p>
  <p>There are a number of existing projects that are designed to ship your local off to a central location:</p>
  <ul>
  <li><a href="https://docs.fluentbit.io/manual/installation/kubernetes" rel="nofollow noreferrer">Fluentbit</a></li>
  <li><a href="https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html" rel="nofollow noreferrer">Filebeat</a></li>
  <li><a href="https://vector.dev/docs/reference/configuration/sources/kubernetes_logs/" rel="nofollow noreferrer">Vector</a></li>
  </ul>
  <p>Etc.</p>
  <p>And following some of the suggestions in the Kubernetes documentation I linked to earlier you could probably write your own (or reconfigure your existing host-based solutions to support your Kubernetes environment as well).</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-09-16T23:51:21.210Z
Answers: 2022-09-16T23:51:21.210Z
Answers: larsks
Body: <p>When I run <code>kubectl logs MyPodNameHere</code> I get back the standard-out of that pod.</p>
  <p>My company has a central logging service for all our applications and I would like to send the <code>logs</code> output to that service.  (Via an <code>HTTPS</code> endpoint.)</p>
  <p>But I can't seem to find a way to hook into a Kubernetes API to get that working.  <strong>Is there a Kubernetes API or other integration point to do this?</strong></p>
  <p>NOTE: I am also using Istio.  I had hopped that I could use that for this, but I can only see stuff about sending &quot;access logs&quot; in the documnation on Istio.  But it seems to me that it should be possible via Istio as well.</p>
  <p><strong>Anyone know a way to get this <code>logs</code> data sent to an HTTPS endpoint?</strong></p>
  
Tags: <kubernetes><istio><kubernetes-on-premises>
Title: Gather kubectl logs data to an external service
UserDisplayName: Vaccano
ThreadText: # Gather kubectl logs data to an external service
  
  (Asked by: username_0 on 2022-09-14)
  
  When I run `kubectl logs MyPodNameHere` I get back the standard-out of that pod.
  
  My company has a central logging service for all our applications and I would like to send the `logs` output to that service. (Via an `HTTPS` endpoint.)
  
  But I can't seem to find a way to hook into a Kubernetes API to get that working. **Is there a Kubernetes API or other integration point to do this?**
  
  NOTE: I am also using Istio. I had hopped that I could use that for this, but I can only see stuff about sending "access logs" in the documnation on Istio. But it seems to me that it should be possible via Istio as well.
  
  **Anyone know a way to get this `logs` data sent to an HTTPS endpoint?**
  
  **Tags:** kubernetes, istio, kubernetes-on-premises
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-09-16. Score: 2 | Accepted answer
  
  There are many products that will ship Kubernetes logs off to a central log server. The kubernetes documentation has [a section on logging](https://kubernetes.io/docs/concepts/cluster-administration/logging/) that is a good place to start.
  
  There are a number of existing projects that are designed to ship your local off to a central location:
  
  * [Fluentbit](https://docs.fluentbit.io/manual/installation/kubernetes)
  * [Filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html)
  * [Vector](https://vector.dev/docs/reference/configuration/sources/kubernetes_logs/)
  
  Etc.
  
  And following some of the suggestions in the Kubernetes documentation I linked to earlier you could probably write your own (or reconfigure your existing host-based solutions to support your Kubernetes environment as well).
  
  
  ---
  
  