【jqコマンド】selectで(23) Failed writing bodyというエラーが出る | 瀬戸内の雲のように

【jqコマンド】selectで(23) Failed writing bodyというエラーが出る

Posted: 2018-01-08


スポンサーリンク

目次

背景

APIの試験やおためしで使う場合にcurlコマンドを使うのですが、
そこで得られた結果を加工する際にjqコマンドも一緒に良く使います。

今回はそんなjqコマンドを使っててプチハマりした内容をメモしておきます。

環境条件

・aws EC2
・amazon linux
・jq-1.5

起こったこと

jqコマンドではキーワードを指定して検索するselectという機能があります(SQLのselectと同じような使い方ができます。)
それを使った時に以下のようなエラーが出てしまいました。

[ec2-user@ip-172-31-30-171 ~]$ curl http://localhost:8080/blogs | jq ".[] | select( .title == 'test1')"
jq: error: syntax error, unexpected INVALID_CHARACTER (Unix shell quoting issues?) at <top-level>, line 1:
.[] | select( .title == 'test1')
jq: 1 compile error
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3790    0  3790    0     0   257k      0 --:--:-- --:--:-- --:--:--  264k
(23) Failed writing body

この時、返って来たjsonは以下なのでコマンド自体が間違っているわけでは無さそうです。

{
  "id": 1,
  "title": "test1",
  "content": "this is test dayo",
  "created_at": "2017-06-01T01:15:26.223Z",
  "updated_at": "2017-06-01T01:15:26.223Z"
}

原因

早速ですが原因はクォーテーションでした。
上記コマンドではjqコマンドの中身を"でくくり、検索するキーワードを'でくくっていますが、
正しくは逆にする必要がありました。

つまり正しいコマンドは以下の通りです。

curl -sS http://localhost:8080/blogs | jq '.[] | select(.title == "test1")'
{
  "id": 1,
  "title": "test1",
  "content": "this is test dayo",
  "created_at": "2017-06-01T01:15:26.223Z",
  "updated_at": "2017-06-01T01:15:26.223Z"
}

これでうまく行きました。

ただ本来はエラーが起きてるコマンドでも正しく動くはずなのにな~?と思ったりしますが。


スポンサーリンク




コメント一覧

2021/07/30 08:47:50

RichardPioseさん

百家樂技巧


2021/07/30 08:58:33

Kennethdusさん

https://vk.com/wall357027_1094


2021/07/30 09:24:59

hydroxy cloroquinさん

how safe is hydroxychloroquine https://plaquenilx.com/# hydroxychloroquine safe


2021/07/30 10:13:45

Kennethdusさん

https://vk.com/wall357027_1097


2021/07/30 10:19:53

Davidrhiseさん

Sochi Charter - Прокат (фрахтование/аренда) яхт Сочи

http://wao.ru/sochi/search/uslugi/razvlechenie-foto-video/razvlecheniya-iskusstvo-prochee/sochi-charter-individualnaja-arenda-jaht-v-sochi-ot-4000-rchas-17526.html?from=add


2021/07/30 10:19:58

KeithpaPさん

viagra canada online pricehow to get real viagra cheap female viagra pills where can i buy viagra over the counter ukwhere can i buy viagra online safely


2021/07/30 10:56:25

Kennethdusさん

https://vk.com/wall357027_1096


2021/07/30 12:19:51

RichardPioseさん

prestige city villas


2021/07/30 12:34:36

Kennethdusさん

https://vk.com/wall357027_1092


2021/07/30 15:20:50

Davidrhiseさん

Sochi Charter - Аренда яхт и катеров в Сочи от 4000 руб. в час от собственника

https://newsbrand.ru/sochi-charter


2021/07/31 02:26:32

RichardPioseさん


2021/07/31 04:05:14

RichardPioseさん

Glasreinigung


2021/07/30 07:56:40

RichardPioseさん


2021/07/30 08:01:50

Bryanelamさん

Fine tips. Thanks a lot.
http://foodnation.us/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/paper/32-write-my-paper-apa-style.html
http://gaunaurdgroup.com/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/thesis/827-thesis-high-quality-essay-services.html
http://checkmyrip.com/__media__/js/netsoltrademark.php?d=freeessayfinder.com/dissertation/615-examples-of-dissertations-excellent-writing.html
http://luvablefriends.com/__media__/js/netsoltrademark.php?d=definitionessays.com/essay/402-community-service-essay-sample-top-ranked.html
http://b2br.net/__media__/js/netsoltrademark.php?d=topessaywritingbase.com/writing/186-rent-a-writer-top-ranked-essay.html
http://eyereelmusic.website/__media__/js/netsoltrademark.php?d=bestessayscloud.com/essay/53-custom-essay-excellent-writing-services.html
http://s4.net/__media__/js/netsoltrademark.php?d=essayhelp-usa.com/thesis/654-write-a-doctoral-thesis-top-ranked.html
how to write a why college essay q20ofw 7d4_01e


2021/07/30 08:51:35

RichardPioseさん


2021/07/30 11:37:16

BruceVaPhさん

Great work man i really appreciate you for this.

I want to share interesting resources:
vMix crack hack
Virtual Serial Port Driver crack new
CommView for WiFi Cracked
vMix crack keygen serial
Smallpdf crack hack
Virtual Serial Port Driver crack keygen serial
Multilizer PDF Translator activator
ГДЗ - готові домашні завдання та рішення
online video downloader


2021/07/30 12:11:44

Davidrhiseさん

Sochi Charter - Прокат (фрахтование/аренда) яхт Сочи

https://freeretail.ru/sochi/otdyh/sochi-charter-arenda-yahty-0ad46a0cf6bf45c0


2021/07/30 15:38:42

Bilyglifyさん

Thanks. Plenty of information!

http://ogawa-usa.com/__media__/js/netsoltrademark.php?d=bestessayscloud.com/writing/00-writing-services-canada-top-ranked-writing.html
http://iehphe.com/__media__/js/netsoltrademark.php?d=bestessayscloud.com/dissertation/09-write-a-dissertation-proposal-best.html
http://njteen.com/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/essay/75-help-to-write-a-comparison-and-contrast.html
http://bpmtnstates.com/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/essay/36-essay-introduction-help-excellent-essay.html
http://jsg13.com/__media__/js/netsoltrademark.php?d=bestessayscloud.com/dissertation/93-dissertation-trading-best-writing-service.html
http://caitlinfurlong.com/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/paper/74-i-will-pay-you-to-write.html
http://sequoiarecords.info/__media__/js/netsoltrademark.php?d=essaypromaster.com/paper/952-write-my-statistics-paper-top-ranked.html


2021/07/30 16:18:01

hydroxicloriquinさん

hydroxycholorquin https://plaquenilx.com/# hydrocholoroquine


2021/07/30 16:57:52

StanleyDabさん

Wow!. Do you like it? i think it will be interestting for you!
https://www.dropbox.com/scl/fi/hhcxxoo8i7s5tecssbusl/Buy-weed-online.paper?dl=0&rlkey=2tcircjg2ix03b41qk8go1nky
https://www.linkedin.com/pulse/buy-weed-online-sakina-noor/

And this:
https://www.rohwrestling.com/content/which-glory-honor-match-are-you-most-anticipating-streaming-live-honorclub?page=42#comment-69294
https://sites.google.com/view/buyweedonline0/home

tQ1Lem

https://flic.kr/p/2mcVDuR


2021/07/30 17:39:09

RichardPioseさん

百家樂


2021/07/30 20:15:31

RichardPioseさん


2021/07/30 22:17:33

Bryanelamさん

With thanks. Lots of facts.

http://estatetaxvaluation.com/__media__/js/netsoltrademark.php?d=definitionessays.com/writing/883-custom-writing-company-top-rated.html
http://alcoholicsanonomys.com/__media__/js/netsoltrademark.php?d=ouressays.com/writing/73-essay-online-writer-excellent-essay.html
http://protectingthejoyofsight.org/__media__/js/netsoltrademark.php?d=bestessayscloud.com/essay/89-please-write-my-attachment-for.html
http://harbourtownvacations.com/__media__/js/netsoltrademark.php?d=topessaywritingbase.com/thesis/48-doctor-working-paper-top-rated.html
http://shieldrns.org/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/editing/17-manuscript-processing-services-high-quality.html
http://doitformeamadeus.com/__media__/js/netsoltrademark.php?d=ouressays.com/thesis/590-phd-themical-search-excellent-essay-services.html
http://shahmarketplace.com/__media__/js/netsoltrademark.php?d=discountedessays.com/essay/94-essay-about-military-service-top-ranked.html
persuasive writing essay e35cwz ddc7d2_


2021/07/30 23:15:04

RichardPioseさん


2021/07/30 23:35:32

Bilyglifyさん

You actually mentioned this effectively.
http://lupin-mexico.com/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/dissertation/145-examples-of-dissertations-high-quality.html
http://michellekristulagreen.com/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/writing/966-phd-writer-best-writing-service.html
http://obrfc.com/__media__/js/netsoltrademark.php?d=essaypromaster.com/paper/748-buy-a-paper-online.html
http://vanaqua.com/__media__/js/netsoltrademark.php?d=essayextra.com/paper/296-buy-school-times-online-top.html
http://swary.com/__media__/js/netsoltrademark.php?d=ouressays.com/paper/71-where-to-buy-papers-affordable.html
http://pigeonbaskets.com/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/essay/61-essay-revision-service-greatest-writing.html
http://www.holidayz.com/__media__/js/netsoltrademark.php?d=essayhelp-usa.com/writing/66-professional-dissertation-writer-excellent-essay.html


2021/07/31 00:39:21

RichardPioseさん


2021/07/31 01:10:12

studybaywsさん

NEED PAPER WRITING ?

Thesis on budgeting process .

Order NOW!!! ==> https://essaypro.co

Thesis about arthur dimmesdale
Format to write a report on industrial visit
Esl personal essay writer site for school

Honor courage commitment essay
Resume educational qualification
Top report writing service usa

Apa cite website no author
Esl reflective essay ghostwriting for hire ca
Essay comparing martin luther king and malcolm x

How to write a research paper chicago style sxtwx
Resume research assistant description tuyxk 2021
Sample freelance proofreader cover letter
Master thesis software development qusgt
ddc7d2_

Professional customer representative resume
Download icwai intermediate question papers
Resume it skills sample

HGtYUPlKMnGFW
EssayPro

Thesis on budgeting process
essaypro
Compare and contrast essay models
Ebp business plan expert 2010 v7 0 0 by fff
Annotated bibliography editor sites au

Documentary film business plan yzbgh 2021
Software freelance resume yvnbn
Help me write cheap creative essay on founding fathers yajvd 2021
Director of engineering resume objective - Top papers ghostwriting sites us uzlgy 2021
Small business plan sample vgbni

https://sites.google.com/view/www-essaypro-com/
tghuTRTjigFIr6F
dissertation network

Thesis on budgeting process
https://www.essaypros.co.uk/edu/
Paintball facility sample business plan
Essays written about the scarlet letter udltf
Best paper editing service for phd kanfl 2021
How to write a civic oration speech trjoz

essay pro
http://K.ob.ejam.Esa.le.ngjianf.Ei2013@lulle.sakura.ne.jp/cgi-bin/kemobook/g_book.cgi/a%C3%BFveronic
http://seotechnology.in/story.php?title=a-secret-weapon-for-essaybot-com-9
http://tvtv16.com/home.php?mod=space&uid=414692

Business report format essay
Free high school homework help sites
Writing a personal statement for college

loansolo login
profi credit

http://pushbuttonplanet.com/forum/member.php?action=viewpro&member=EduBirdiecom
https://www.file-upload.com/15d8gsg79q40

Eating disorders and media research paper
Professional dissertation results writers site for mba
Help me write technology essays

https://whitehatcommunity.com/showthread.php?tid=425127
http://beta.rover800.info/2020/03/29/hello-world/?unapproved=227690&moderation-hash=0b4fd6b3f6bfa94e78dbe602e0ea4a0d#comment-227690
https://www.macadamiaplus.com.au/product/exfoliating-scrub/?unapproved=77427&moderation-hash=a9acff24bf0d5aee088a9b8f0359b06f#comment-77427

Thesis on budgeting process

studybay
https://irinalapteva.com/benefits-of-learning-to-dance/?unapproved=136164&moderation-hash=5f8cf9375e1bcbd0a5cd3b195f076a19#comment-136164
http://lovenutritionsimply.com/hello-world/?unapproved=1192&moderation-hash=fc916165c0913777223fec8ac0661113#comment-1192
https://www.wildlifewilly.com/topic/examples-for-blog/page/12/#post-98191

Help writing a book software htztv
Cover letter examples human resources cthoe 2021
Write a prescription for yourself ulnuh
Top essays ghostwriter sites gb qprzc

Thesis on budgeting process
Masters cover letter
Popular dissertation methodology proofreading websites jvybp 2021
Specialized skills for resume examples vazyy
Analytical essay on tell tale heart hkngt

Sociology research paper topics ideas
Causes and effects of the pollution essay
Nhs - essay on scholarship

Thesis on budgeting process
General employment resume xqciz
Popular resume writer for hire au odrhb 2021
Thesis investment
Duke university thesis template emale
Prima j homework download qwcuo 2021
Thesis acknowledgement for friends sample nbwed


2021/07/31 01:11:08

RichardPioseさん

娛樂城 推薦


2021/07/30 18:53:54

RichardPioseさん


2021/07/30 19:13:21

Dennisequabさん

Точное время, часовой пояс, разница во времени, время восхода и заката, основные факты о Москва, Россия.

Узнать время в Москве онлайн.


2021/07/30 19:34:04

KeithpaPさん

viagra 30 mgbuy viagra in us online female viagra pills sildenafil 50 mg onlinewhere can you buy viagra over the counter in australia


2021/07/30 21:15:18

RichardPioseさん


2021/07/31 01:00:56

StronWenさん

https://qps.ru/EzfUR https://gee.su/9yFap https://gee.su/Ke7ZW https://gee.su/0eaCP https://qps.ru/lysTd https://gee.su/9Cyzc https://qps.ru/TFNB6 https://qps.ru/pCtX7 https://qps.ru/ITHsF https://gee.su/Jzrbl https://gee.su/9dwMS https://gee.su/GhM86 https://gee.su/YyxC6 https://qps.ru/HuKeG https://clck.ru/WPqYK https://gee.su/gzBsU https://gee.su/UZzTE https://gee.su/MHmQ2 https://clck.ru/WQFzr https://clck.ru/WQ8Wd
https://clck.ru/WPZ4q https://gee.su/3eg7E https://gee.su/BhTE2 https://qps.ru/JH736 https://clck.ru/WQ6bi https://qps.ru/pjxCv https://clck.ru/WQeL3 https://clck.ru/WPW3X https://qps.ru/oJAUf https://qps.ru/0is1Q https://qps.ru/PdymM https://gee.su/ek9HL https://gee.su/2xqm6 https://qps.ru/Nnegp https://qps.ru/EKmFZ https://clck.ru/WPSXh https://clck.ru/WQYJs https://cutt.us/kRzfl https://qps.ru/jdinP https://qps.ru/ZPWy8
https://qps.ru/pifYX https://qps.ru/fKtR3 https://gee.su/qhVpI https://qps.ru/L0e7l https://qps.ru/NJCMR https://clck.ru/WPaz2 https://qps.ru/rqRFs https://clck.ru/WPSCe https://gee.su/Ao7uR https://qps.ru/odh26 https://gee.su/y07XD https://qps.ru/a1AYr https://gee.su/iROVN https://gee.su/2aXUP https://qps.ru/tsENz https://gee.su/CHPT3 https://clck.ru/WPYpn https://gee.su/6JaWg https://qps.ru/LAm3I https://clck.ru/WPYA2


2021/07/31 01:52:56

Herbertmayokさん

[url=https://mir74.ru]челябинск 74[/url]


2021/07/31 03:20:39

RichardPioseさん

百家樂技巧


2021/07/31 04:27:26

RichardPioseさん


2021/07/31 04:28:24

Devidvexさん

With thanks, Terrific information!
http://christopherwblack.com/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/essay/61-essays-help-best-essay-services.html
http://jerseyshorereportcard.com/__media__/js/netsoltrademark.php?d=topessaywritingbase.com/essay/499-write-my-essay-canada-top.html
http://simesrealty.com/__media__/js/netsoltrademark.php?d=bestessayscloud.com/essay/90-service-to-other-essay-affordable.html
http://flyingmonkey.biz/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/paper/32-college-paper-write-service-reviews-top-ranked.html
http://hiephoiiso.com/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/paper/536-online-research-paper-recorder-top.html
http://surfermodels.com/__media__/js/netsoltrademark.php?d=bestessayseducationusa.com/writing/271-write-my-report-free-of-charge.html
http://puttimeonyourside.com/__media__/js/netsoltrademark.php?d=topessayservicescloud.com/writing/48-web-content-writer-greatest-essay.html
how to write personal essay p68nou 553ddc7


2021/07/31 04:30:31

JeremyFoedsさん

https://kinogoo.cc/3335-serial-ekstrasensy-vedut-rassledovanie-2011-12-sezon-1-seriya-smotret-online-besplatno-na-kinogo.html


2021/07/31 04:41:34

Robertatombさん

https://kinogoo.by/2032-spisok-kontaktov-2008.html


2021/07/31 05:57:04

hydroxicloroquinさん

hydroxychlorophine https://plaquenilx.com/# is hydroxychloroquine safe


2021/07/31 05:25:28

Bryanelamさん

Cheers, Plenty of facts.

http://advisar.direct/__media__/js/netsoltrademark.php?d=topessayservicescloud.com/essay/05-convincing-essay-writing-help-excellent.html
http://dentalmedhealth.com/__media__/js/netsoltrademark.php?d=bestessayscloud.com/paper/542-write-my-paper-cheap-for.html
http://jackiandcathy.com/__media__/js/netsoltrademark.php?d=essayhelp-usa.com/writing/523-write-websites-for-students-greatest.html
http://millheyfarm.com/__media__/js/netsoltrademark.php?d=discountedessays.com/writing/49-custom-written-high-quality-essay.html
http://cynthiahartman.com/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/essay/759-critical-essay-help-excellent-writing.html
http://frenchengagementrings.co.uk/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/paper/766-how-do-i-buy-a-research.html
http://moretify.biz/__media__/js/netsoltrademark.php?d=topessaywritinglist.com/editing/271-college-essay-correction-reader-top.html
essay writer helper t253ta c15553d



コメントを投稿する


お名前


コメント内容





TOP back