# Using the follow parameter when fetching Pod logs from the browser via the Rest API does not get the latest log content

**URL:** <https://discuss.kubernetes.io/t/using-the-follow-parameter-when-fetching-pod-logs-from-the-browser-via-the-rest-api-does-not-get-the-latest-log-content/28244>\
**Category:** General Discussions\
**Created:** [May 14, 2024, 8:13am UTC](https://discuss.kubernetes.io/t/using-the-follow-parameter-when-fetching-pod-logs-from-the-browser-via-the-rest-api-does-not-get-the-latest-log-content/28244 "2024-05-14T08:13:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Windlike\_Mr](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/windlike_mr/32/14973_2.png) [@Windlike\_Mr](https://discuss.kubernetes.io/u/Windlike_Mr)\
**Post date:** [May 14, 2024, 8:13am UTC](https://discuss.kubernetes.io/t/using-the-follow-parameter-when-fetching-pod-logs-from-the-browser-via-the-rest-api-does-not-get-the-latest-log-content/28244/1 "2024-05-14T08:13:48Z")

</div>

A very strange question. When I make a request to fetch the Pod log in the browser, it doesn’t return the latest content, but cURL makes the same request to fetch it. Does anyone know why?

This is the result you get in the browser, and you can see that the latest log entry was 11:20.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/kubernetes/original/2X/5/5059dc8ff93255e1d954caa91b9a09cd4999e3d1.jpeg)

This is a cURL request to the same address, and the latest log entry is 15:55, which is correct.

---

<div class="post-metadata">

**Author:** ![Unyn](https://avatars.discourse-cdn.com/v4/letter/u/54ee81/32.png) [@Unyn](https://discuss.kubernetes.io/u/Unyn)\
**Post date:** [May 16, 2024, 10:26am UTC](https://discuss.kubernetes.io/t/using-the-follow-parameter-when-fetching-pod-logs-from-the-browser-via-the-rest-api-does-not-get-the-latest-log-content/28244/2 "2024-05-16T10:26:21Z")

</div>

If you’re using Kubernetes, you’re likely interacting with the Kubernetes API to fetch Pod logs. When making requests to fetch Pod logs, you typically use the Kubernetes API [https://tech-stack.com/blog/what-is-an-api/](https://tech-stack.com/blog/what-is-an-api/) endpoint for logs, which follows this general format:  
GET /api/v1/namespaces/{namespace}/pods/{podName}/log

Here’s how you might use this API endpoint:  
curl [https://your-kubernetes-cluster/api/v1/namespaces/{namespace}/pods/{podName}/log](https://your-kubernetes-cluster/api/v1/namespaces/%7Bnamespace%7D/pods/%7BpodName%7D/log)

Replace {namespace} with the namespace of your Pod and {podName} with the name of your Pod.

To ensure that you’re getting the latest log content, you can add the follow parameter to the request URL. This parameter tells the server to stream the logs in real-time. Here’s the modified curl command:  
curl [https://your-kubernetes-cluster/api/v1/namespaces/{namespace}/pods/{podName}/log?follow=true](https://your-kubernetes-cluster/api/v1/namespaces/%7Bnamespace%7D/pods/%7BpodName%7D/log?follow=true)

This command should ensure that you’re receiving the latest log content as it becomes available. If you’re using a browser to make the request, ensure that the URL includes the follow=true parameter as well.
