Day 5 of Shell Scripting — Log Analysis Like a Real DevOps Engineer [Writing this at 4:03 PM IST] Most people learn commands. Today I learned to think in pipelines. Day 5 was all about grep, awk, and sort — and how combining them turns raw log files into actual intelligence. What I practiced on a real app.log file: grep — filtered errors, debugs, warnings with -i (case insensitive), -n (line numbers), -c (count), -v (exclude). Found 7 ERROR entries and 4 DEBUG entries instantly. awk — extracted specific fields from those filtered lines. Timestamp + service component in one clean output. sort — sorted that output by service name using -k2 to group all database, api, auth errors together. The final command that clicked for me: grep "ERROR" app.log | awk '{print $2, $4}' | sort -k2 Three tools. One pipeline. Instant clarity on which service is failing most. This is exactly what you need when you're on-call at 2 AM and a production system is throwing errors. No GUI. Just you, the terminal, and your grep flags. Day 5 done. Pipeline thinking unlocked. 🔥 #DevOps #Linux #ShellScripting #BashScripting #100DaysOfCode #DevOpsJourney #Korelium
Log Analysis with Grep, Awk, and Sort in Shell Scripting
More Relevant Posts
-
Automating Everything That Should Never Be Done Twice: SSH, Python, Bash & PowerShell ⚙️🚀 In my experience, SSH, Python, Bash, and PowerShell were not just tools, they were the backbone of how I turned repetitive operations into reliable automation 🔁 It usually started with SSH. That was the entry point into systems, whether Linux servers, cloud instances, or container hosts. Instead of logging in manually and running commands one by one, I used SSH as a gateway to execute tasks remotely, securely, and consistently across environments 🔐 On top of that, Bash scripting handled a lot of day-to-day automation in Linux environments. Things like system setup, deployments, log parsing, service restarts, cron jobs, and quick operational fixes. Bash was fast, direct, and perfect for tasks that needed to run close to the system 🐧 When automation needed logic, scale, or integration, Python took over. I used it to build smarter workflows, interact with APIs, process data, orchestrate cloud resources, and connect multiple systems together. Python made automation flexible instead of just command execution 🐍 For Windows-heavy or Azure-aligned environments, PowerShell played a key role. It helped automate administrative workflows, manage resources, and execute structured tasks in a more controlled and readable way compared to manual operations ⚡ What made this combination powerful was how they worked together: SSH for secure remote execution Bash for fast system-level automation Python for intelligent orchestration PowerShell for structured administrative control This stack helped reduce manual work, eliminate configuration drift, and make operations predictable across environments. For me, automation was never about writing scripts. It was about removing friction, increasing reliability, and giving systems the ability to run the same way every time ☁️ #SSH #Python #Bash #PowerShell #Automation #DevOps #SRE #CloudEngineering #InfrastructureAutomation #CICD #PlatformEngineering
To view or add a comment, sign in
-
📊 Wrote a Simple Disk Usage Check Script in Bash Today I worked on a small but practical script that checks the current disk usage of a system. 🔧 What it does: ------------------- ✔️ Uses df -h to get disk usage ✔️ Extracts the usage percentage ✔️ Displays the current disk usage clearly 💡 Why this matters: ----------------------- Disk space issues are one of the most common reasons for system failures. Even a basic visibility like this can help in identifying problems early. 🧠 What I learned: --------------------- Working with system commands like df Parsing output using awk and sed Writing cleaner and more readable shell scripts 🚀 Next Improvements: --------------------------- This is just the starting point. If we extend this using cron, we can: ➡️ Run this script at regular intervals ➡️ Continuously monitor disk usage ➡️ Trigger alerts when usage crosses a limit ➡️ Avoid unexpected downtime 🔗 GitHub Repo: https://lnkd.in/gcSQEJUq I’m building a collection of practical DevOps scripts — feel free to explore and ⭐ if you find them useful! #DevOps #Linux #ShellScripting #Automation #LearningInPublic #SRE #Bash
To view or add a comment, sign in
-
-
🚀 Automated Jenkins Upgrade with Python – No Manual Effort! Keeping Jenkins up-to-date is critical for security and stability… but let’s be honest — doing it manually is boring and error-prone 😅 So I built a Python script that: ✅ Fetches the latest LTS version directly from Jenkins ✅ Detects the currently running version using Java ✅ Compares versions intelligently ✅ Downloads the latest WAR file automatically ✅ Safely stops Jenkins, updates the WAR, and restarts it 💡 Bonus: Added detailed validation logs at every step for better debugging and reliability. This is a simple yet powerful automation that can save time for DevOps teams managing multiple Jenkins instances. 🔧 Tech Stack: Python 🐍 Linux (systemctl) Jenkins WAR deployment 📌 Why this matters: Automating routine maintenance tasks = Less downtime + More productivity Would love your thoughts 👇 How are you managing Jenkins upgrades in your environment? #DevOps #Jenkins #Automation #Python #SRE #Cloud #CI_CD #InfrastructureAsCode
To view or add a comment, sign in
-
-
🚀 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗲𝗱 𝗥𝗲𝗺𝗼𝘁𝗲 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 & 𝗪𝗲𝗯 𝗦𝗲𝗿𝘃𝗲𝗿 𝗢𝗿𝗰𝗵𝗲𝘀𝘁𝗿𝗮𝘁𝗶𝗼𝗻 𝘂𝘀𝗶𝗻𝗴 𝗣𝘆𝘁𝗵𝗼𝗻 𝗙𝗮𝗯𝗿𝗶𝗰 Instead of configuring servers one by one, I built a fully automated system to provision and deploy web servers across multiple machines remotely. 💡 What I built: Created a multi-VM environment using Vagrant (scriptbox, web01, web02) Configured passwordless SSH authentication for seamless remote execution Set up /etc/hosts for hostname-to-IP mapping Developed a Python automation script using Fabric to: Install and configure Apache (httpd) Manage services (start & enable) Download, package, and deploy a website Executed the same deployment across multiple servers remotely with a single command 🌍 Why this matters: This approach enables automation at scale — instead of repeating manual steps, the same script can be used to configure and deploy across many remote machines consistently and efficiently. 🔥 Key Learning: Remote execution and orchestration across multiple nodes Eliminating manual configuration with automation Building repeatable and scalable deployment workflows ⚙️ Tech Stack: Python • Fabric • Linux • Vagrant • Apache ⚡ Next step: Extend this into a full CI/CD pipeline and explore tools like Ansible for large-scale infrastructure management. #DevOps #Automation #Python #Linux #Vagrant #Fabric #RemoteExecution #SystemAdministration #SoftwareEngineering
To view or add a comment, sign in
-
“It Works on My Machine” — The Most Dangerous Sentence in Software Engineering Every developer has encountered this phrase at least once. Your code may function flawlessly in your local environment, but the moment it reaches production, it can break. Why does this happen? Because local is not production. Here’s what really changes: - Different environments (OS, Java version, configurations) - Real-world messy data versus clean local data - High concurrency (1 user versus 10,000 users) - Security layers (authentication, firewalls, CORS) - External service failures - Deployment inconsistencies Production is not just a “bigger local” — it’s a completely different system. What I learned: - Make the local environment closer to production (Docker can help) - Never rely on assumptions about data - Add proper logging and monitoring - Test under real-world load - Use CI/CD to avoid deployment mistakes Production failures can be frustrating, but they often provide the most valuable lessons. #LearnFromFailures #EngineeringMindset #ContinuousLearning #DeveloperJourney #TechExperience #BackendEngineering #SoftwareEngineering #ProductionIssues #Debugging #SystemDesign #Java #SpringBoot #WebDevelopment #TechLessons #EngineeringLife
To view or add a comment, sign in
-
Logging in Spring Boot: Not Just for Debugging 🚀 When building applications with Spring Boot, logging often starts as a simple tool to print messages during development. But in real-world systems, logging becomes much more than that — it’s your window into how your application behaves in production. Here’s why logging is essential: 🔍 Debugging & Troubleshooting When something goes wrong, logs are the first place you look. A well-structured log can help you quickly identify the root cause without needing to reproduce the issue. 📊 Monitoring & Observability Logs provide insights into application flow, performance bottlenecks, and unusual patterns. Combined with monitoring tools, they help you stay proactive rather than reactive. 🔐 Security & Auditing Tracking user actions, login attempts, and critical operations through logs helps in auditing and detecting suspicious activities. ⚙️ Production Support In distributed systems or microservices, you can’t rely on breakpoints. Logs act as your primary source of truth to understand inter-service communication and failures. “Code tells you what the system should do, but logs tell you what it actually did.” Invest time in good logging practices early — it will save countless hours in debugging and maintenance later. #SpringBoot #Java #BackendDevelopment #Logging #Microservices #SoftwareEngineering
To view or add a comment, sign in
-
🚀 CI/CD Pipeline for a Java App using Jenkins, Docker & Kubernetes Built a simple end-to-end pipeline using a Jenkinsfile to automate building and deploying a Java application to Kubernetes cluster. - Pipeline Stages: • Pull the code and detect any changes • Build the code • Build application and database images • Push images to Docker Hub • Deploy to Kubernetes - Stack: • Jenkins (Pipeline as Code) • Docker • Kubernetes • GitHub 💡 Key Issues & Fixes: • Docker build failed (DNS issue) → fixed Docker network/DNS • Kubernetes auth failed → added kubeconfig for Jenkins • Permission issue on certificates → fixed Linux permissions • App not accessible → fixed Service port mismatch 🔗 GitHub Repo: https://lnkd.in/dsHrE2bW 🙏 Thanks to Eng. Gamal Mohammad and Eng. Abdelrahman Ahmed for the guidance and support as always. #DevOps #Jenkins #Kubernetes #Docker #Java #CICD #GitHub #ArgoCD
To view or add a comment, sign in
-
🎉 Module 2 is now LIVE! "Introduction to Jenkins: Continuous Integration & Automated Builds on WSL" If you've ever wondered how real-world software teams automate their builds and tests — this hands-on lab manual walks you through it step by step! 💡 🛠 Built around a single real project — hello-ci (Java Spring Boot) — so every concept you learn is immediately applied. 📖 6 structured labs covering: → Jenkins architecture & core concepts → Installing Jenkins on WSL 2 (Ubuntu 22.04) → Setting up your first CI Pipeline → Integrating Jenkins with Maven → Running automated builds & JUnit tests → Red/Green CI philosophy in practice 📚 This is Module 2 of the DevOps Lab Manual Series: ✅ Module 1 — Maven & Gradle: https://lnkd.in/d7-MFTGM ✅ Module 2 — Jenkins CI/CD: https://lnkd.in/d-_w-ikv 🔜 Module 3 — Ansible | Module 4 — Azure DevOps 💻 GitHub: https://lnkd.in/d95hihu7 Free to read, use & cite! Drop a comment or share with someone learning DevOps 🙌 #Jenkins #DevOps #CICD #WSL #Java #Maven #OpenEducation #VTU #LabManual #LearningByDoing #AJIET
To view or add a comment, sign in
-
If you jump between tech stacks, you've probably hit this: wrong extensions loaded, wrong context, manual profile switching. I built `vs-code-profile-helpers` to fix that — shell scripts that keep stack-based VS Code profiles at user level and open any repo with the right one automatically. Nothing committed into your projects. Short write-up here: https://lnkd.in/eM-yF5e6 Would love to hear if others have tackled this differently. #vscode #devtools #zsh #developerexperience
To view or add a comment, sign in
-
At some point, running commands stops being enough. You start asking: why am I doing this more than once? I’ve completed the Introduction to Shell Scripting Basics certification from CodeSignal as part of the Mastering Shell Scripting with Bash path. This stage marked a shift from simple execution to structured control—moving from typing commands to building logic that can make decisions and act independently. I worked through variable manipulation, including string handling and arithmetic expansion $((...)), while also navigating Bash’s strict whitespace rules that demand precision. I implemented conditional logic using if-elif-else structures with both numeric and string operators, built and iterated through arrays using different loop strategies, and created reusable functions using positional parameters ($1, $2) and $@ to handle multiple inputs efficiently. The key takeaway is straightforward: automation starts with how well you structure small things. This foundation is what enables everything else in system scripting and DevOps. #ShellScripting #Bash #Linux #Automation #DevOps #SoftwareEngineering #BackendDevelopment #Programming #Coding #TechSkills #ContinuousLearning #Developers #Engineering #CommandLine #Productivity #Scripting #Unix #TechCareer #CodeSignal #brittonnetic CodeSignal https://lnkd.in/dAB9TMRF
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development