課程
/云計算&大數據
/大數據
/Elastic Stack入門
window 系統可以使用什么命令替代,head
2017-12-01
源自:Elastic Stack入門 3-5
正在回答
windows 下可以替代 head 的命令是 gc
https://stackoverflow.com/questions/9682024/how-to-do-what-head-tail-more-less-sed-do-in-powershell
gc log.txt | select -first 10 # headgc -TotalCount 10 log.txt ? ? # also headgc log.txt | select -last 10 ?# tailgc -Tail 10 log.txt ? ? ? ? ? # also tail (since PSv3), also much faster than above optiongc log.txt | more ? ? ? ? ? ? # or less if you have it installedgc log.txt | %{ $_ -replace '\d+', '($0)' } ? ? ? ? # sed
gc log.txt | select -first 10 # head
gc -TotalCount 10 log.txt ? ? # also head
gc log.txt | select -last 10 ?# tail
gc -Tail 10 log.txt ? ? ? ? ? # also tail (since PSv3), also much faster than above option
gc log.txt | more ? ? ? ? ? ? # or less if you have it installed
gc log.txt | %{ $_ -replace '\d+', '($0)' } ? ? ? ? # sed
sunyaox 提問者
Get-Content nginx.log -TotalCount 2|./filebeat -e -c ngnix.yml
進入到解壓的filebeat-6.0.0-windows-x86_64下,然后將nginx.yml拷貝到目錄下。
打開dos窗口切換目錄到filebeat-6.0.0-windows-x86_64,執行輸入命令? filebeat -e -c nginx.yml? 回車。
將nginx.log的兩條日志內容,粘貼到啟動的到dos窗口,就可以了。
然后呢
舉報
Elasticsearch、Logstash、Beats、Kibana基礎知識入門
1 回答關于啟動集群信息顯示問題
1 回答logstash監聽文件或定時啟動問題
4 回答logstash啟動報錯
5 回答packetbeat 無法啟動
2 回答Windows下啟動ElasticSearch報錯
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-12-01
windows 下可以替代 head 的命令是 gc
https://stackoverflow.com/questions/9682024/how-to-do-what-head-tail-more-less-sed-do-in-powershell
2018-04-19
Get-Content nginx.log -TotalCount 2|./filebeat -e -c ngnix.yml
2017-12-01
進入到解壓的filebeat-6.0.0-windows-x86_64下,然后將nginx.yml拷貝到目錄下。
打開dos窗口切換目錄到filebeat-6.0.0-windows-x86_64,執行輸入命令? filebeat -e -c nginx.yml? 回車。
將nginx.log的兩條日志內容,粘貼到啟動的到dos窗口,就可以了。
2017-12-01
然后呢