Exclude name-XXX-YY #143
-
Hello! Awasome application!
I use
But log dont hidden. How exclude name-XXX-YY ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
I confirmed with a simple application. 'use strict';
const express = require('express');
const PORT = 8080;
const HOST = '0.0.0.0';
const app = express();
app.get('/', (req, res) => {
console.log(`request from ${req.headers.host}`);
console.log('js-agent-mongodb-7949d5c4f6-98lzr mongodb {"t":{"$date":"2021-07-16T12:58:39.391+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn102","msg":"Connection ended","attr":{"remote":"127.0.0.1:33104","connectionId":102,"connectionCount":1}}')
res.send('Hello World');
});
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`); But I could filter it. # without --exclude option
$ ~/tmp/stern_1.19.0_linux_amd64/stern nodeapp-b
+ nodeapp-bf5dfc49f-mxjww › nodeapp
nodeapp-bf5dfc49f-mxjww nodeapp Running on http://0.0.0.0:8080
nodeapp-bf5dfc49f-mxjww nodeapp request from node0:31000
nodeapp-bf5dfc49f-mxjww nodeapp js-agent-mongodb-7949d5c4f6-98lzr mongodb {"t":{"$date":"2021-07-16T12:58:39.391+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn102","msg":"Connection ended","attr":{"remote":"127.0.0.1:33104","connectionId":102,"connectionCount":1}}
^C
# with --exclude option
$ ~/tmp/stern_1.19.0_linux_amd64/stern --exclude 'js-agent-mongodb*' nodeapp-b
+ nodeapp-bf5dfc49f-mxjww › nodeapp
nodeapp-bf5dfc49f-mxjww nodeapp Running on http://0.0.0.0:8080
nodeapp-bf5dfc49f-mxjww nodeapp request from node0:31000
^C This is reproduced in WSL2(Ubuntu 20.04) + Zsh + stern 1.19.0. Which version and environment are you using? |
Beta Was this translation helpful? Give feedback.
-
Hi all. Any news? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
How exclude line contain "GET / HTTP/1.1" 200 ?
Run
Work
But exluce HTTP CODE 200 and 500. |
Beta Was this translation helpful? Give feedback.
stern
provides three exclusion ways, as follows--exclude
is for log messages. If you want to target pod names, you can use--exclude-pod
.