From 0d456e77b9ccf61d98d7381f0424ae9f6295901d Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:46:06 +0800 Subject: [PATCH 1/2] docs: fix format of json data in body --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a425f7a..449e85b 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ output { curl -XPOST -D- "http://localhost:5601/api/saved_objects/index-pattern" \ -H "Content-Type: application/json" \ -H "kbn-version: 6.1.0" \ - -d "{'attributes':{'title':'logstash-*','timeFieldName':'@timestamp'}}" + -d '{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}' ``` 如果你是 Windows 用戶,請用其他方法,雖然 Windows 也有 curl,但我裝上去執行指令, From a9e3e1ea8722892253a8986f017ca52a185e3f0d Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:00:32 +0800 Subject: [PATCH 2/2] docs: leave two types of command line arguments --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 449e85b..1537caf 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,11 @@ curl -XPOST -D- "http://localhost:5601/api/saved_objects/index-pattern" \ -d '{"attributes":{"title":"logstash-*","timeFieldName":"@timestamp"}}' ``` +如果上面的指令有報有關json格式錯誤的問題,也可以試試看將最後一行改為: +```cmd + -d "{'attributes':{'title':'logstash-*','timeFieldName':'@timestamp'}}" +``` + 如果你是 Windows 用戶,請用其他方法,雖然 Windows 也有 curl,但我裝上去執行指令, 他都會報錯說 josn格式錯誤,所以我直接改用 [Postman](https://www.getpostman.com/)