[{"data":1,"prerenderedAt":202},["ShallowReactive",2],{"i-lucide:sun-moon":3,"i-lucide:menu":8,"post-\u002Fblog\u002F2024-02-06-using-journctl":10,"surround-\u002Fblog\u002F2024-02-06-using-journctl":185,"i-lucide:arrow-left":196,"i-lucide:sparkles":198,"i-lucide:user":200},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 2v2m2.837 12.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715M16 12a4 4 0 0 0-4-4m7-3l-1.256 1.256M20 12h2\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",{"id":11,"title":12,"authors":13,"body":16,"date":172,"description":173,"extension":174,"meta":175,"navigation":178,"path":179,"seo":180,"stem":181,"tags":182,"toc":6,"__hash__":184},"blog\u002Fblog\u002F2024-02-06-using-journctl.md","Using journalctl",[14,15],"gpt","pfarmer",{"type":17,"value":18,"toc":165},"minimark",[19,34,39,53,77,80,84,87,104,108,125,141,144,147,161],[20,21,22,26,27,30,31,33],"p",{},[23,24,25],"code",{},"journalctl"," is a powerful command-line utility for querying and displaying messages from the journal, managed by ",[23,28,29],{},"systemd-journald",". It is commonly used on Linux systems to retrieve and analyse log data. This guide aims to provide instructions on using ",[23,32,25],{}," based on the questions you've previously asked.",[35,36,38],"h2",{"id":37},"getting-the-last-1000-lines","Getting the Last 1000 Lines",[20,40,41,42,45,46,49,50,52],{},"To retrieve the last 1000 lines from the journal logs, you can use the ",[23,43,44],{},"-n"," or ",[23,47,48],{},"--lines"," option with ",[23,51,25],{},":",[54,55,60],"pre",{"className":56,"code":57,"language":58,"meta":59,"style":59},"language-bash shiki shiki-themes github-light github-dark-default","journalctl -n 1000\n\n","bash","",[23,61,62],{"__ignoreMap":59},[63,64,67,70,74],"span",{"class":65,"line":66},"line",1,[63,68,25],{"class":69},"sYRkA",[63,71,73],{"class":72},"sPgVT"," -n",[63,75,76],{"class":72}," 1000\n",[20,78,79],{},"This command will display the most recent 1000 lines of the journal logs",[35,81,83],{"id":82},"getting-the-last-100-lines-and-then-following-the-log","Getting the last 100 lines and then following the log",[20,85,86],{},"To get the last 100 lines and follow live updates, you can combine the -n option with the -f or --follow option:",[54,88,90],{"className":56,"code":89,"language":58,"meta":59,"style":59},"journalctl -n 100 -f\n",[23,91,92],{"__ignoreMap":59},[63,93,94,96,98,101],{"class":65,"line":66},[63,95,25],{"class":69},[63,97,73],{"class":72},[63,99,100],{"class":72}," 100",[63,102,103],{"class":72}," -f\n",[35,105,107],{"id":106},"display-logs-since-a-specific-time","Display logs since a specific time.",[20,109,110,111,114,115,118,119,45,122,52],{},"If you want to see logs starting from a particular point in time, you can use the ",[23,112,113],{},"--since"," option. The time format can be flexible, such as ",[23,116,117],{},"YYYY-MM-DD HH:MM:SS",", or even simpler like ",[23,120,121],{},"yesterday",[23,123,124],{},"1 hour ago",[54,126,128],{"className":56,"code":127,"language":58,"meta":59,"style":59},"journalctl --since \"2024-02-01 14:00:00\"\n",[23,129,130],{"__ignoreMap":59},[63,131,132,134,137],{"class":65,"line":66},[63,133,25],{"class":69},[63,135,136],{"class":72}," --since",[63,138,140],{"class":139},"sNbzA"," \"2024-02-01 14:00:00\"\n",[20,142,143],{},"This command will display logs from February 1st, 2024, starting at 2:00 PM.",[20,145,146],{},"Alternatively, to view logs from the last hour:",[54,148,150],{"className":56,"code":149,"language":58,"meta":59,"style":59},"journalctl --since \"1 hour ago\"\n",[23,151,152],{"__ignoreMap":59},[63,153,154,156,158],{"class":65,"line":66},[63,155,25],{"class":69},[63,157,136],{"class":72},[63,159,160],{"class":139}," \"1 hour ago\"\n",[162,163,164],"style",{},"html pre.shiki code .sYRkA, html code.shiki .sYRkA{--shiki-default:#6F42C1;--shiki-dark:#FFA657}html pre.shiki code .sPgVT, html code.shiki .sPgVT{--shiki-default:#005CC5;--shiki-dark:#79C0FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sNbzA, html code.shiki .sNbzA{--shiki-default:#032F62;--shiki-dark:#A5D6FF}",{"title":59,"searchDepth":166,"depth":166,"links":167},3,[168,170,171],{"id":37,"depth":169,"text":38},2,{"id":82,"depth":169,"text":83},{"id":106,"depth":169,"text":107},"2024-02-06","journalctl is a powerful command-line utility for querying and displaying messages from the journal, managed by systemd-journald. It is commonly used on Linux systems to retrieve and analyse log data. This guide aims to provide instructions on using journalctl based on the questions you've previously asked.","md",{"type":176,"layout":177},"post","blog_page",true,"\u002Fblog\u002F2024-02-06-using-journctl",{"title":12,"description":173},"blog\u002F2024-02-06-using-journctl",[183],"devops","XXaztZn7AsnemHZDIChx0CIc900pUeMJsMeuvWkmHUw",[186,191],{"title":187,"path":188,"stem":189,"date":190,"children":-1},"Using git reset","\u002Fblog\u002F2023-10-03-using-git-reset","blog\u002F2023-10-03-using-git-reset","2023-10-03",{"title":192,"path":193,"stem":194,"date":195,"children":-1},"How to Migrate Data from One MongoDB Database to Another","\u002Fblog\u002F2024-05-08-howto-migrate-a-monogdb","blog\u002F2024-05-08-howto-migrate-a-monogdb","2024-05-08",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":197},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 19l-7-7l7-7m7 7H5\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":199},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594zM20 2v4m2-2h-4\"\u002F>\u003Ccircle cx=\"4\" cy=\"20\" r=\"2\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":201},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"\u002F>\u003Ccircle cx=\"12\" cy=\"7\" r=\"4\"\u002F>\u003C\u002Fg>",1783616165128]