{"id":8328,"date":"2023-01-22T10:33:25","date_gmt":"2023-01-22T01:33:25","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=8328"},"modified":"2023-02-13T19:56:47","modified_gmt":"2023-02-13T10:56:47","slug":"linux%e3%82%b7%e3%82%a7%e3%83%ab%e3%81%a7%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%83%ad%e3%82%b0%e3%81%ab%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8%e3%82%92%e5%87%ba%e5%8a%9b%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/8328","title":{"rendered":"Linux\u306e\u30b7\u30a7\u30eb\u3067\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3059\u308b\uff01\uff08logger\uff09"},"content":{"rendered":"<p>Linux\u306e\u30b7\u30a7\u30eb\u3067\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u306b\u3001logger\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>logger\u30b3\u30de\u30f3\u30c9\u306e\u30d8\u30eb\u30d7\u3092\u8868\u793a\u3059\u308b\uff01<\/h2>\n<p>logger\u30b3\u30de\u30f3\u30c9\u306e\u30d8\u30eb\u30d7\u3092\u8868\u793a\u3057\u3066\u3001\u4f7f\u7528\u65b9\u6cd5\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ logger --help\r\n\r\nUsage:\r\n logger &#x5B;options] &#x5B;&lt;message&gt;]\r\n\r\nEnter messages into the system log.\r\n\r\nOptions:\r\n -i                       log the logger command's PID\r\n     --id&#x5B;=&lt;id&gt;]          log the given &lt;id&gt;, or otherwise the PID\r\n -f, --file &lt;file&gt;        log the contents of this file\r\n -e, --skip-empty         do not log empty lines when processing files\r\n     --no-act             do everything except the write the log\r\n -p, --priority &lt;prio&gt;    mark given message with this priority\r\n     --octet-count        use rfc6587 octet counting\r\n     --prio-prefix        look for a prefix on every line read from stdin\r\n -s, --stderr             output message to standard error as well\r\n -S, --size &lt;size&gt;        maximum size for a single message\r\n -t, --tag &lt;tag&gt;          mark every line with this tag\r\n -n, --server &lt;name&gt;      write to this remote syslog server\r\n -P, --port &lt;port&gt;        use this port for UDP or TCP connection\r\n -T, --tcp                use TCP only\r\n -d, --udp                use UDP only\r\n     --rfc3164            use the obsolete BSD syslog protocol\r\n     --rfc5424&#x5B;=&lt;snip&gt;]   use the syslog protocol (the default for remote);\r\n                            &lt;snip&gt; can be notime, or notq, and\/or nohost\r\n     --sd-id &lt;id&gt;         rfc5424 structured data ID\r\n     --sd-param &lt;data&gt;    rfc5424 structured data name=value\r\n     --msgid &lt;msgid&gt;      set rfc5424 message id field\r\n -u, --socket &lt;socket&gt;    write to this Unix socket\r\n     --socket-errors&#x5B;=&lt;on|off|auto&gt;]\r\n                          print connection errors when using Unix sockets\r\n     --journald&#x5B;=&lt;file&gt;]  write journald entry\r\n\r\n -h, --help               display this help\r\n -V, --version            display version\r\n\r\nFor more details see logger(1).\r\n<\/pre>\n<h2>\/var\/log\/messages\u306b\u30ed\u30b0\u51fa\u529b\u3059\u308b\uff01<\/h2>\n<p>\/var\/log\/messages\u306b\u30ed\u30b0\u51fa\u529b\u3057\u307e\u3059\u3002\u30d7\u30ed\u30bb\u30b9ID\u3092\u51fa\u529b\u3001\u30d7\u30e9\u30a4\u30aa\u30ea\u30c6\u30a3\u3092\u300ccrit\u300d\u3001\u30bf\u30b0\u3092\u300ctest.sh\u300d\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u300cTest Message!\u300d\u3067\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ logger -ip local0.crit -t test.sh &quot;Test Message!&quot;\r\n<\/pre>\n<p>\u30ed\u30b0\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo grep &quot;Test Message!&quot; \/var\/log\/messages\r\nDec 12 08:55:28 server01 test.sh&#x5B;31136]: Test Message!\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>logger\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30b7\u30a7\u30eb\u306e\u30a8\u30e9\u30fc\u306a\u3069\u3092\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u306b\u5bb9\u6613\u306b\u51fa\u529b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/8692\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08bash\uff09\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08bash\uff09<\/div><div class=\"substr\">Linux\u306ebash\u3067\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3067\u3059\u3002...<\/div><\/a><\/div>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/7679\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Linux\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>\u95a2\u9023\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<p><iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=infotecr-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=4774186945&linkId=51dbc0ee6d79ef74ced87300db344bdb\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u306e\u30b7\u30a7\u30eb\u3067\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u306b\u3001logger\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[189],"tags":[],"class_list":["post-8328","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shell-script"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/8328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=8328"}],"version-history":[{"count":0,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/8328\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5527"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=8328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=8328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=8328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}