-
Notifications
You must be signed in to change notification settings - Fork 56
FEATURE: Add cmdlog optional filtering #935
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
base: develop
Are you sure you want to change the base?
Conversation
5ceae4f to
d16a097
Compare
|
์๊ฒฌ์ด ํ์ํ ๋ถ๋ถ์ด ๋ช ๊ฐ ์์ด ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค.
|
|
๊ฐ์ธ ์๊ฒฌ์ ๋๋ค.
์ด ๊ฒฝ์ฐ๋ ์ฌ์ฉ์๊ฐ ์๋ชป ๋ฃ์ ๊ฒฝ์ฐ์ ํด๋นํ๋ฏ๋ก ๋ณ๋ค๋ฅธ ์ฒ๋ฆฌ๋ฅผ ํ ํ์๊ฐ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๋์ ์ผ๋ก ๋ณ๊ฒฝ๋์ด๋ ์๊ด์์ ๊ฒ ๊ฐ์ต๋๋ค. |
cmdlog.c
Outdated
| } else if ((command[0] == 'l' || | ||
| command[0] == 's' || | ||
| command[0] == 'm' || | ||
| command[0] == 'b') && | ||
| strcmp(command + 1, "op") == 0) { | ||
| return 2; | ||
| } | ||
|
|
||
| return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด ํจ์ ํธ์ถ๋๋ ์์ ์ด ntokens ๊ฒ์ฆํ๊ธฐ ์ ์ธ๋ฐ,
tokens[key_idx]๊ฐ ํญ์ ์กด์ฌํ๋ ๊ฒ์ด ๋ณด์ฅ๋๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐฉ์ด ์ฝ๋๊ฐ ๋น ์ ธ ์์์ต๋๋ค. key_idx ๋ณ ntokens ๊ฒ์ฌ ๋ก์ง์ ์ถ๊ฐํ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ -1 -> 2 -> ๋๋จธ์ง 1 ์์๋ก ๋น๊ตํ๊ณ ์์ต๋๋ค.
key๊ฐ ์๋ ๋ช
๋ น์ ๋จผ์ ํ์ธํ์ฌ 1 ๋๋ 2 ๋ฐํํ๊ณ ,
๊ทธ ์ธ(์ ์ ์๋ ๊ฒฝ์ฐ ํฌํจ) ๋ช
๋ น์ ๋ํด -1 ๋ฐํํ๋ ๊ฒ์ด ๊ฐ์ฅ ๋ง์ง๋ง์ด์ด์ผ ์์ฐ์ค๋ฌ์ด ํํ์ด์ง ์๋ ์๊ฐํฉ๋๋ค.
๋๋, command๊ฐ ์๋ tokens ์ธ์๋ก ๋ฐ์ผ๋ฉด key ๋ฌธ์์ด์ ๋ฐ๋ก ๋ฐํํ ์ ์์ด ๋ณด์
๋๋ค.
ntokens ๋น๊ต ๋ก์ง ๋ฑ๋ ์์ฐ์ค๋ฝ๊ฒ ํจ์ ์์ชฝ์ผ๋ก ์ด๋๋ ๊ฒ์
๋๋ค.
cmdlog.c
Outdated
| if (key_idx > 0) { | ||
| snprintf(key, CMDLOG_FILTER_KEY_MAXLEN + 1, "%s", tokens[key_idx].value); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key์ ๋ฌธ์์ด ๋ณต์ฌํ์ง ์๊ณ tokens[key_idx].value ๊ฐ ๋ฐ๋ก ์ฌ์ฉํ์ ๋ ๋ฌธ์ ๊ฐ ๋๋ ๋ถ๋ถ์ด ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ฐ๋ก ์ฌ์ฉํด๋ ๋ฌธ์ ๋ ์์ต๋๋ค. key ์ง์ญ๋ณ์๋ฅผ ์ฌ์ฉํ ์ด์ ๋ key๋ฅผ ์๊ตฌํ์ง ์๋ command์ ๊ฒฝ์ฐ key_idx๊ฐ -1์ด ๋๋ฏ๋ก ์ธ๋ฑ์ค ์ ๊ทผ์ ๋ฐฐ์ ํด์ผ ํ๋๋ฐ, ๋น๊ต ์ค -1์ ์ฒดํฌํ๊ธฐ๋ณด๋จ ์ฌ์ ์ ํ์ธํ๊ณ ํํฐ ์ํ ์ค์๋ ๋น๊ต๋ง ์ํํ๋ ๊ฒ ๊ฐ๋
์ฑ์ด ๋ ์ข์๋ณด์ฌ ์ ํํ ๊ฒ์
๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ๋
์ฑ์ ์ํด ์ง์ญ๋ณ์ ๋๋ ๊ฒ์๋ ํฌ๊ฒ ์ด๊ฒฌ ์์ง๋ง,
๋ฐฐ์ด์ ๋ฌธ์์ด์ ๋ค์ ์ฐ์ง ์๊ณ ๋จ์ํ tokens ๋๋ empty string์ ๊ฐ๋ฆฌํค๋ ํฌ์ธํฐ๋ก ๊ด๋ฆฌํด๋
๊ฐ๋
์ฑ ์ธก๋ฉด์์ ํ์ฌ PR ๊ตฌํ๊ณผ ํฌ๊ฒ ์ฐจ์ด๊ฐ ์์ ๊ฒ์
๋๋ค.
memcached.c
Outdated
| int len = command_len + key_len + 26; | ||
| char *buf = (char *)malloc(len); | ||
| if (buf) { | ||
| snprintf(buf, len, "\tFilter: command = %s, key = %s", command, key); | ||
| out_string(c, buf); | ||
| free(buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋์ ๊ฐ์ด ์๋ต ๋ง์ง๋ง ๋ถ๋ถ์ด ์๋ ค ๋ณด์ ๋๋ค.
$ telnet devbox.gcp.namsic.dev 11211
Trying 35.216.32.213...
Connected to devbox.gcp.namsic.dev.
Escape character is '^]'.
cmdlog filter add command add key 01
Filter: command = add, key =
cmdlog filter add command replace
Filter: command = replace, key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ถ๋ ฅ ๋ฒํผ ํฌ๊ธฐ๋ฅผ ์์ ํ์ต๋๋ค.
82661ae to
bb79672
Compare
cmdlog.c
Outdated
| } else if ((command[0] == 'l' || | ||
| command[0] == 's' || | ||
| command[0] == 'm' || | ||
| command[0] == 'b') && | ||
| strcmp(command + 1, "op") == 0) { | ||
| return 2; | ||
| } | ||
|
|
||
| return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ -1 -> 2 -> ๋๋จธ์ง 1 ์์๋ก ๋น๊ตํ๊ณ ์์ต๋๋ค.
key๊ฐ ์๋ ๋ช
๋ น์ ๋จผ์ ํ์ธํ์ฌ 1 ๋๋ 2 ๋ฐํํ๊ณ ,
๊ทธ ์ธ(์ ์ ์๋ ๊ฒฝ์ฐ ํฌํจ) ๋ช
๋ น์ ๋ํด -1 ๋ฐํํ๋ ๊ฒ์ด ๊ฐ์ฅ ๋ง์ง๋ง์ด์ด์ผ ์์ฐ์ค๋ฌ์ด ํํ์ด์ง ์๋ ์๊ฐํฉ๋๋ค.
๋๋, command๊ฐ ์๋ tokens ์ธ์๋ก ๋ฐ์ผ๋ฉด key ๋ฌธ์์ด์ ๋ฐ๋ก ๋ฐํํ ์ ์์ด ๋ณด์
๋๋ค.
ntokens ๋น๊ต ๋ก์ง ๋ฑ๋ ์์ฐ์ค๋ฝ๊ฒ ํจ์ ์์ชฝ์ผ๋ก ์ด๋๋ ๊ฒ์
๋๋ค.
cmdlog.c
Outdated
| if (key_idx > 0) { | ||
| snprintf(key, CMDLOG_FILTER_KEY_MAXLEN + 1, "%s", tokens[key_idx].value); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ๋
์ฑ์ ์ํด ์ง์ญ๋ณ์ ๋๋ ๊ฒ์๋ ํฌ๊ฒ ์ด๊ฒฌ ์์ง๋ง,
๋ฐฐ์ด์ ๋ฌธ์์ด์ ๋ค์ ์ฐ์ง ์๊ณ ๋จ์ํ tokens ๋๋ empty string์ ๊ฐ๋ฆฌํค๋ ํฌ์ธํฐ๋ก ๊ด๋ฆฌํด๋
๊ฐ๋
์ฑ ์ธก๋ฉด์์ ํ์ฌ PR ๊ตฌํ๊ณผ ํฌ๊ฒ ์ฐจ์ด๊ฐ ์์ ๊ฒ์
๋๋ค.
cmdlog.c
Outdated
| static int get_key_idx_by_command(const char *command) | ||
| { | ||
| assert(command); | ||
| if (strstr(command, "mget") || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strcmp()๊ฐ ์๋ strstr() ์ฌ์ฉํ๋ ์ด์ ๋ ๋ฌด์์ธ๊ฐ์?
*mget* ํํ์ ๋ช
๋ น์ด ๋ชจ๋ ๋งค์นญ๋ ๊ฒ์ธ๋ฐ,
๋ค๋ฅธ ๋ช
๋ น๋ค์ด ์ ํํ ์ผ์น ์ฌ๋ถ๋ฅผ ํ์ธํ๋ ๊ฒ์ ๋นํ์ฌ ๋ชจํธํ ๋ก์ง์ผ๋ก ๋ณด์
๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mget, bop_mget, bop_smget ๋ช
๋ น๋ค์ ๋ชจ๋ key ๊ฒ์ฌ๋ฅผ ์ํํ์ง ์๊ธฐ๋ก ํ๊ธฐ ๋๋ฌธ์ ๋์ดํ์ง ์๊ณ strstr()๋ก ๋ฌธ์์ด ๋งค์นญ์ ์ฌ์ฉํ์ต๋๋ค.
cmdlog.c
Outdated
| if (cmdlog.nfilters >= CMDLOG_FILTER_MAXNUM) { | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lock ์ก์ ์ํ๋ก ํ์ธํด์ผ ํ์ง ์๋์ง?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_cmdlog_filter_match(), cmdlog_filter_add(), cmdlog_filter_list() lock ๊ด๋ จ ์ฝ๋ ์์ ํ์ต๋๋ค.
1fcd0b9 to
5924b63
Compare
d384f48 to
b0db1d8
Compare
|
@jhpark816 |
|
@6unYoung |
์๋ฏธ์ ๋ง๋ EBNF ํ์์ผ๋ก ์์ ํ์ต๋๋ค. |
| inputstr[nwritten++] = ' '; | ||
| ptr++; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@6unYoung
์ฌ๊ธฐ ์ฝ๋ ์์ ์ ๋ฒ๊ทธ๋ฅผ ์ ๊ฑฐํ๊ธฐ ์ํ ๊ฒ์ธ๊ฐ์?
๊ธฐ์กด ์ฝ๋๋ฅผ ์กฐ๊ธ ์์ ํด์๋ ํด๊ฒฐํ ์ ์์ ๊ฒ ๊ฐ์ ๋ฐ์. ์ด๋ค๊ฐ์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น ์ฝ๋๋ cmdlog_write() ํธ์ถ ์ ์ tokenize_command()๋ฅผ ๋จผ์ ํธ์ถํ๊ฒ ์์ ํ๊ธฐ ๋๋ฌธ์ ์ถ๊ฐ๋์์ต๋๋ค. command๊ฐ tokenized๋ ์ํ์ด๋ฏ๋ก ๋ ๋ฌธ์๋ฅผ ๊ฑด๋๋ฐ๋ฉด์ ์ปค๋งจ๋ ๋ผ์ธ ์ ์ฒด๋ฅผ ์
๋ ฅ๋ฐ๊ฒ ํ์ต๋๋ค.
d8ae576 to
7fa8720
Compare
| return; | ||
| } | ||
|
|
||
| ntokens = tokenize_command(command, cmdlen, tokens, MAX_TOKENS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@6unYoung
tokenize_command() ์ํํ๊ณ ๋๋ฉด, command ๋ฌธ์์ด์ด ํผ์๋ฉ๋๋ค.
๋ฐ๋ผ์, command ๋ฌธ์์ด์ ๊ทธ๋๋ก ๋ก๊น
ํ๋ ๊ฒ์ด ์ด๋ ค์ธ ๊ฒ ๊ฐ์ ๋ฐ์.
ํ์ธํด ๋ณด์๋์?
jhpark816
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ผ๋ถ ๋ฆฌ๋ทฐ
| } | ||
| } else { | ||
| out_string(c, "ERROR unknown command"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOCS๋ ๋ฐ์ํด ์ฃผ์์ฃ .
์ ํํ ์ธํฐํ์ด์ค๋ฅผ ํ์ธํ๊ณ ์ ํฉ๋๋ค.
| if (!safe_strtol(tokens[3].value, &idx)) { | ||
| idx = -1; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค์ ์ดํด๋ณด๋, ์๋ ์ธํฐํ์ด์ค๊ฐ ์ง๊ด์ ์ด๊ณ ๋ช ํํ ๊ฒ ๊ฐ์ต๋๋ค.
remove <index>
remove all
memcached.c
Outdated
| if (buf) { | ||
| snprintf(buf, buf_size, "\tFilter: command = %s, key = %s", command, key); | ||
| out_string(c, buf); | ||
| free(buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK\r\n ์๋ตํ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ด๋ค๊ฐ์?
| command = tokens[4].value; | ||
| command_len = tokens[4].length; | ||
| key = tokens[6].value; | ||
| key_len = tokens[6].length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key ๋ค์์ command ๋ช ์ํ๋ ๊ฒ์ ํ์ฉํ์ง ์๋ค์.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์์ ์ ์ํ ์ธํฐํ์ด์ค์๋ ํด๋น ํ์์ ํ์ฉํ์ง ์์ต๋๋ค.
-cmd ๊ฐ์ด ์์ ์๊ด ์๋ ์ต์
ํ์์ด ์๋๊ณ , ์์น๊ฐ ์ ํด์ง๊ณ ์ ํ ๊ฐ๋ฅํ ์ธ์ ๋ฐฉ์์ผ๋ก ํ๊ธฐํ๊ธฐ์ ์์ ๋ฐ๊ฟ์ ํ์ฉํ์ง ์์์ต๋๋ค.
memcached.c
Outdated
| out_string(c, "SERVER_ERROR out of memory"); | ||
| } | ||
| } else if (ret == 0) { | ||
| out_string(c, "CLIENT_ERROR filter list is full"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLIENT_ERROR ๋ณด๋ค๋ SERVER_ERROR๊ฐ ๋์ ๊ฒ ๊ฐ์ต๋๋ค.
memcached.c
Outdated
| int buf_size = 32; | ||
| char buf[buf_size]; | ||
| snprintf(buf, buf_size, "\t%d filters removed", ret); | ||
| out_string(c, buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฌ๊ธฐ๋ ์๋์ ๊ฐ์ด ๊ตฌ๋ถ๋์ด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
- OK
- SERVER_ERROR filter list is empty
| strcmp(command + 1, "op") == 0) { | ||
| if ((cmdlen == 8 && memcmp(command, "bop_mget", 8) == 0) || | ||
| (cmdlen == 9 && memcmp(command, "bop_smget", 9) == 0)) { | ||
| return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 ๋ฆฌํดํ๋ ์ด์ ๋ ๋ฌด์์ธ๊ฐ์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mget๋ฅ ๋ช
๋ น์ ๊ฒฝ์ฐ์ key๋ฅผ ๋ณ๋์ ๋ผ์ธ์ผ๋ก ์
๋ ฅ๋ฐ๊ธฐ์ ํค๋ฅผ ํํฐ๋งํ๊ธฐ์ ๋ฒ๊ฑฐ๋กญ๊ณ , ๊ธฐ์กด cmdlog ๋์์์๋ ํค ๋ผ์ธ์ ๋ก๊น
ํ์ง ์๊ณ ์์ต๋๋ค.
๋ฐ๋ผ์ mget๋ฅ ๋ช
๋ น์ key๋ฅผ ์ฌ์ฉํ์ง ์์ผ๋ฏ๋ก -1์ ๋ฐํํ๊ณ ์์ต๋๋ค.
| (cmdlen == 6 && memcmp(command, "delete", 6) == 0) || | ||
| (cmdlen == 7 && memcmp(command, "getattr", 7) == 0) || | ||
| (cmdlen == 7 && memcmp(command, "setattr", 7) == 0) || | ||
| (cmdlen == 5 && memcmp(command, "touch", 5) == 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ธฐ์กด์๋ ๋ชจ๋ ๋ช
๋ น์ ๋ก๊น
ํ ์ ์์์ง๋ง,
ํ์ฌ๋ config, zkensemble ๋ฑ์ ๋ช
๋ น์ ๋ก๊น
ํ์ง ์๋ค์.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ก๊น ๊ฐ๋ฅํฉ๋๋ค.
| pthread_mutex_lock(&cmdlog.lock); | ||
| for (int i = 0; i < cmdlog.nfilters; ++i) { | ||
| if (cmdlog.filters[i].command[0] == '\0' || strcmp(command, cmdlog.filters[i].command) == 0) { | ||
| if (cmdlog.filters[i].key[0] == '\0' || strcmp(key, cmdlog.filters[i].key) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exact match๋ง ํ์ฉ๋๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค ๋ง์ต๋๋ค
|
|
||
| pthread_mutex_lock(&cmdlog.lock); | ||
| for (int i = 0; i < cmdlog.nfilters; ++i) { | ||
| if (cmdlog.filters[i].command[0] == '\0' || strcmp(command, cmdlog.filters[i].command) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lop ๋ช ๋ น ์ ์ฒด๋ฅผ ๋ก๊น ํ๋ ๊ฒ์ ์ ๋๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collection type์ ๋ํด ๋ถ๋ถ ๋งค์นญ์ ํ์ฉํ๋ฉด ๋ค๋ฅธ ๋ช ๋ น์ด์ ๋ํด์๋ ๋์ผํ ๋์์ ๊ธฐ๋ํ ๊ฒ ๊ฐ์๋ฐ, ํด๋น ๋ถ๋ถ์ ๊ณ ๋ คํด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
0e94dd1 to
9ae5839
Compare
9ae5839 to
f4f96c4
Compare
| if (ntokens < 3 || ntokens > 4) { | ||
| out_string(c, "\t* Usage: cmdlog [start [path] | stop | stats]\n"); | ||
| if (ntokens < 3) { | ||
| out_string(c, "\t* Usage: cmdlog [start [path] | stop | stats | filter [add|remove|list]]\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋ notation์ผ๋ก ๋ณ๊ฒฝํ์์ฃ .
cmdlog { start [path] | stop | stats | filter { add | remove | list } }
๐ Related Issue
โจ๏ธ What I did
cmdlog filter๋ช ๋ น์ ์ฒ๋ฆฌํ๋process_cmdlog_filter()ํจ์๋ฅผ ์ถ๊ฐํ์ต๋๋ค.is_cmdlog_filter_match()ํจ์๋ฅผ ์ถ๊ฐํ์ต๋๋ค.cmdlog_write()๊ฐ ๊ธฐ์กด๊ณผ ๋์ผํ ๋์์ ํ๊ฒ๋ command์ ๋ํ ๋ก์ง์ ์์ ํ์ต๋๋ค.cmdlog_add(), cmdlog_remove(), cmdlog_list()ํจ์๋ฅผ ์ถ๊ฐํ์ต๋๋ค.struct cmd_log_filter filters[CMDLOG_FILTER_MAXNUM]์ ์ถ๊ฐํ์ต๋๋ค.๋ช ์ธ
cmdlog filter add (command <cmd> | key <key> | command <cmd> key <key>)๋ก ํํฐ๋ฅผ ๋ฑ๋กํ๋ค. command, key ์ต์ ์ค ํ๋๋ ์๋ตํ ์ ์๋ค. ์๋ต๋ ์ต์ ์ ํํฐ๋งํ์ง ์๋๋ค. ๋ฌธ์ ์ ํจ์ฑ ๊ฒ์ฌ๋ ์ํํ์ง๋ง, ๋ช ๋ น์ด์ ํค์ ์กด์ฌ ์ฌ๋ถ๋ฅผ ๊ฒ์ฌํ์ง ์๋๋ค. ํํฐ ์์๋ ์ ํ์ด ์กด์ฌํ๋ค.์์
cmdlog filter remove (index)๋ก ํํฐ๋ฅผ ์ญ์ ํ๋ค. ์ธ๋ฑ์ค๋ฅผ ์ ๋ ฅํ๋ฉด ์ฐพ์ ์ญ์ ํ๊ณ , ์๋ต ์ ๋ชจ๋ ํํฐ๋ฅผ ์ญ์ ํ๋ค.์์
cmdlog filter list๋ก ํํฐ ๋ชฉ๋ก์ ์ถ๋ ฅํ๋ค. ํ์ฌ ํํฐ ์์ ์ต๋ ํํฐ ์๋ฅผ ๊ฐ์ด ์ถ๋ ฅํ๋ค.์์