Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubectl logs with flag --since-time return logs before the timesamp #77856

Open
luzhzhsoft opened this issue May 14, 2019 · 4 comments

Comments

Projects
None yet
5 participants
@luzhzhsoft
Copy link

commented May 14, 2019

What happened:
When I use kubectl logs with flag --since-time .Kubenetes return logs before the timestamp ,not after.For example , timestamp is 2019-05-08T06:02:13.431834004Z ,but log's timestamp
is 2019-05-08T06:02:13.324986342Z.
kubectl logs --since-time="2019-05-08T06:02:13.431834004Z" --timestamps=true --limit-bytes=1024 auth-develop-2407-74f8c47899-zqnrx -n default-57

2019-05-08T06:02:13.324986342Z 2019/05/08 06:02:13 http2: Framer 0xc4207ec1c0: read HEADERS flags=END_HEADERS stream=1 len=88 2019-05-08T06:02:13.325046497Z 2019/05/08 06:02:13 http2: decoded hpack field header field ":method" = "POST" 2019-05-08T06:02:13.325069415Z 2019/05/08 06:02:13 http2: decoded hpack field header field ":scheme" = "http" 2019-05-08T06:02:13.325452553Z 2019/05/08 06:02:13 http2: decoded hpack field header field ":path" = "/pb.Auth/GetUser" 2019-05-08T06:02:13.325495002Z 2019/05/08 06:02:13 http2: decoded hpack field header field ":authority" = "10.0.110.238:8080" 2019-05-08T06:02:13.325513303Z 2019/05/08 06:02:13 http2: decoded hpack field header field "content-type" = "application/grpc" 2019-05-08T06:02:13.325539113Z 2019/05/08 06:02:13 http2: decoded hpack field header field "user-agent" = "grpc-go/1.14.0-dev" 2019-05-08T06:02:13.325559643Z 2019/05/08 06:02:13 http2: decoded hpack field header field "te" = "trailers" 2019-05-08T06:02:13.325575644Z 2019/05/08 06:02:13 http2: decoded hpa
What you expected to happen:
Only return logs after a specific date (RFC3339) just as kubernetes document say
How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):1.10.2
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):CentOS Linux 7
  • Kernel (e.g. uname -a): 4.12.4-1.el7.elrepo.x86_64
  • Install tools:
  • Network plugin and version (if this is a network-related bug):
  • Others:
@athenabot

This comment has been minimized.

Copy link

commented May 14, 2019

/sig autoscaling

These SIGs are my best guesses for this issue. Please comment /remove-sig <name> if I am incorrect about one.

🤖 I am a bot run by vllry. 👩‍🔬

@yue9944882

This comment has been minimized.

Copy link
Member

commented May 14, 2019

/remove-sig autoscaling
/sig cli

@fenglixa

This comment has been minimized.

Copy link

commented May 18, 2019

Using "docker logs --since" could show the correct logs result, even defined milliseconds time.
Checked the kubernetes code, the milliseconds was lost during converting. Will provide a PR for this issue.

BR
-Francis

@fenglixa fenglixa referenced a pull request that will close this issue May 18, 2019

Open

Fix issue of kubectl logs with flag --since-time #78071

@luzhzhsoft

This comment has been minimized.

Copy link
Author

commented May 20, 2019

@fenglixa
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.