{"id":5561,"date":"2023-07-19T12:32:08","date_gmt":"2023-07-19T12:32:08","guid":{"rendered":"https:\/\/middleware.io\/backend\/?p=5561"},"modified":"2023-08-01T07:29:28","modified_gmt":"2023-08-01T07:29:28","slug":"search-logs-effectively-with-log-management","status":"publish","type":"post","link":"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/","title":{"rendered":"How To Search Logs Effectively With Log Management"},"content":{"rendered":"\n<p>The <a href=\"https:\/\/www.marketsandmarkets.com\/Market-Reports\/log-management-market-66937877.html\" target=\"_blank\" rel=\"noreferrer noopener\">Markets and Markets<\/a> report suggests that the global log management market is expected to grow from $2.3 billion in 2021 to $4.1 billion by 2026. This is due to rapid digital transformation and the hyperflexibility of the cloud environment, which is dominated by Amazon Web Services, Microsoft Azure, and Google Cloud Platform.<\/p>\n\n\n\n<div id=\"parent-banner\">\n   <div class=\"sticky-banner\" id=\"sticky-banner\">\n      <img decoding=\"async\" src=\"\/images\/blog\/blog-banner.svg\" alt=\"banner\">\n      <h4>Get a free developer account and start making your systems observable.<\/h4>\n      <a href=\"https:\/\/app.middleware.io\/auth\/register\/\" target=\"_blank\" rel=\"noopener\"><button class=\"bordered-orange bottom-button white arrow\">Get started free<\/button><\/a>\n   <\/div>\n<\/div>\n\n\n\n<p>Searching log files can be a tedious task, as they are often large and unwieldy. Log files provides insights into when and where issues occur. Therefore, it is an important skill to be able to search log files to solve critical problems quickly.&nbsp;<\/p>\n\n\n\n<p>There are many reasons to search log files:<\/p>\n\n\n\n<ol><li>To find the source of a problem. Log files are valuable resources for troubleshooting problems.<\/li><li>To find events with specific timestamps or between two timestamps.<\/li><li>To search for a log with a particular error using a specific keyword (error or fatal).<\/li><li>Checking logs for warnings.<\/li><\/ol>\n\n\n\n<div id=\"accordian\" class=\"table-of-content\">\n<div class=\"toc-heading accordion\" data-toggle=\"collapse\" data-target=\"#toc\">Table of Contents<\/div>\n<div id=\"toc\" class=\"collapse\" data-parent=\"#accordian\">\n<div class=\"toc-list\">&nbsp;<\/div>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-search-logs-effectively\">How to Search logs effectively?<\/h2>\n\n\n\n<p>Various teams use log events to investigate bugs in code, search for the root cause of outages, and so on. Therefore, searching logs is an important process. There are different ways to search logs effectively. One is to use the bash command, and the other is to use a <a href=\"https:\/\/middleware.io\/product\/log-monitoring\/\">log monitoring tool<\/a>.<\/p>\n\n\n\n<p>Let&#8217;s discuss both ways one by one.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-using-bash-command\">1. Using Bash Command&nbsp;<\/h3>\n\n\n\n<p>If you are a Windows user, install <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/wsl\/install\">Linux on Windows with WSL<\/a>. After installation, open the Bash shell and change the directory where the log file is present. Now, you are all set to perform log searching using bash commands.<\/p>\n\n\n\n<p>Bash commands are instructions that allow you to interact with the shell. They are very useful for performing a wide variety of tasks. The Bash Unix Shell provides various commands that can be used to filter and search data.<\/p>\n\n\n\n<p>Using bash commands, you can search logs effectively. For example, you can search for all the logs with errors or warnings. You can also search logs by timestamps, or you can search for logs between two timestamps.<\/p>\n\n\n\n<p>Now, let&#8217;s explore the <strong>Grep <\/strong>bash command to search logs effectively.<\/p>\n\n\n\n<p>According to the <a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/grep.1.html\">Linux manual<\/a>, <em>grep <\/em>searches for patterns in each file. Patterns can be one or more patterns separated by newline characters, and grep prints each line that matches a pattern.<\/p>\n\n\n\n<p>The pattern should be quoted when used in a shell.<\/p>\n\n\n\n<p>Suppose we have the following dataset in a log file. Now, we are going to use the <em>grep <\/em>command on the dataset.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"540\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.1-1024x540.jpg\" alt=\"grep command on the dataset\" class=\"wp-image-5586\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.1-1024x540.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.1-300x158.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.1-768x405.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.1-1536x810.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.1-1200x632.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.1.jpg 1645w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Let&#8217;s start by searching for the errors in the log file. There are various errors in the log file, but we will search for the word &#8220;<em>failure<\/em>&#8221; in the log file. We need to pass the word &#8220;<em>failure<\/em>&#8221; with the <em>grep <\/em>command and remember that the <strong><em>grep command is case-sensitive<\/em><\/strong>, so take care of that.<\/p>\n\n\n\n<p>To do this, first, we need to read the log file using the <em>cat <\/em>command and then use the grep command with the pipe symbol (|).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Command:<\/strong><\/h4>\n\n\n\n<p><em>cat log.txt | grep \u201cfailure\u201d<\/em><\/p>\n\n\n\n<p>See the image below. When we enter the word &#8220;Failure&#8221;, no results appear. However, when using the word &#8220;failure&#8221;, all the logs having failure has been displayed in the console.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"321\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.2.jpg\" alt=\"grep \u201cfailure\u201d\" class=\"wp-image-5587\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.2.jpg 880w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.2-300x109.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.2-768x280.jpg 768w\" sizes=\"(max-width: 880px) 100vw, 880px\" \/><\/figure>\n\n\n\n<p>Next, suppose we have two types of errors in the log file. The first has the word &#8220;disconnect,&#8221; and the other has the word &#8220;disconnected&#8221;. <\/p>\n\n\n\n<p>Now, if we use the grep command to search for the word &#8220;disconnect&#8221;, the error with the word &#8220;disconnected&#8221; will also appear in the console, as you can see below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"417\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.3-1024x417.jpg\" alt=\"disconnect from service\" class=\"wp-image-5589\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.3-1024x417.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.3-300x122.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.3-768x313.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.3.jpg 1093w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, what if we want the result for the exact word only? To do this, we can use the <em>-w<\/em> option to tell the <em>grep <\/em>command to match the exact word.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Command:<\/strong><\/h4>\n\n\n\n<p><em>cat log.txt | grep -w \u201cdisconnect\u201d<\/em><\/p>\n\n\n\n<p>You can see below that we only have logs matching the exact word.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"293\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.4-1024x293.jpg\" alt=\"grep -w \u201cdisconnect\u201d\" class=\"wp-image-5590\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.4-1024x293.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.4-300x86.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.4-768x219.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.4.jpg 1092w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>What if we filter all the logs with all kinds of errors, like &#8220;failure&#8221;, &#8220;disconnected&#8221;, etc.? To do this, we have to use the <em>-E<\/em> option with the <em>grep <\/em>command.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Command:<\/strong><\/h4>\n\n\n\n<p><em>cat log.txt | grep -E \u201cdisconnect|Fail\u201d<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"307\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.5-1024x307.jpg\" alt=\"grep -E \u201cdisconnect Fail\u201d\" class=\"wp-image-5591\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.5-1024x307.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.5-300x90.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.5-768x230.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.5.jpg 1090w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>See above; all the logs that have the words &#8220;Fail&#8221; or &#8220;disconnect&#8221; have been displayed.<\/p>\n\n\n\n<p>Now, for larger log files that have millions of data, the number of returned results can have thousands of matches. What if we want to know the count of all the matches? For this, we can use the <em>-wc<\/em> command along with <em>-l<\/em>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Command:<\/strong><\/h4>\n\n\n\n<p><em>cat log.txt | grep -E \u201cdisconnect|Fail\u201d | wc -l<\/em><\/p>\n\n\n\n<p>As you can see below, we have 6 results for the above words.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"368\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.6-1024x368.jpg\" alt=\"cat log txt\" class=\"wp-image-5592\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.6-1024x368.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.6-300x108.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.6-768x276.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.6.jpg 1093w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Cool! Now that we have explored the <em>grep <\/em>command, we can see how useful it is for searching logs effectively.&nbsp;<\/p>\n\n\n\n<p>Recent hires in an organization may struggle to build log queries for quick searches. It is time-consuming, so organizations should prioritize log management tools to reduce manual efforts. <\/p>\n\n\n\n<p>This is where log monitoring tools like middleware come into the picture, as they provide a seamless log search experience.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-using-middleware\">2. Using Middleware<\/h3>\n\n\n\n<p><a href=\"https:\/\/middleware.io\/\">Middleware<\/a> provides a seamless, point-and-click log search experience that makes it easy to conduct efficient log investigations. It includes:<\/p>\n\n\n\n<ol><li>Use the search option and advanced filters to easily analyze logs and find patterns.<\/li><li>Search for error messages, warning messages, or other types of log entries.<\/li><li>Save and reuse the search query for faster troubleshooting.&nbsp;<\/li><li>View historical log data with the time travel feature.<\/li><\/ol>\n\n\n\n<p>\u2026and a lot more.<\/p>\n\n\n\n<p>Now, create a <a href=\"https:\/\/app.middleware.io\/auth\/register\/\">middleware account<\/a>, go to your middleware dashboard, and click on the installation button just above the setting at the bottom left. You will see all three agents (Kubernetes, Linux, and Docker); click on any, and copy the full command.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.7-1024x465.jpg\" alt=\"Middleware agent installation\" class=\"wp-image-5593\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.7-1024x465.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.7-300x136.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.7-768x348.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.7-1536x697.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.7-1200x544.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.7.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Middleware&#8217;s agent installation screen<\/figcaption><\/figure>\n\n\n\n<p><strong>Note that<\/strong> first, you need to <a href=\"https:\/\/docs.middleware.io\/docs\/agent-installation\/host-agent\">install the agent<\/a> in your system. You can either install Kubernetes, Linux, or Docker-based agents. After the agent installation is completed and make sure it is running, paste the command (that you copied from your middleware dashboard) into the bash shell.<\/p>\n\n\n\n<p>After all the installations, make sure to verify the status of the agent.<\/p>\n\n\n\n<p>Now, let\u2019s look at how middleware can help to investigate logs more quickly, especially during time-critical scenarios such as service outages, security breaches, etc.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-reduced-mttr-with-autocomplete-queries\"><strong>1. Reduced MTTR with Autocomplete queries:<\/strong><\/h3>\n\n\n\n<p>Autocomplete queries can help reduce mean time to recovery (MTTR). It makes it easy to find the information needed to troubleshoot problems. It helps you find the right log file by suggesting possible matches for your provided keyword.<\/p>\n\n\n\n<p>The middleware autocomplete search bar helps you write complex log queries by providing suggestions of possible matching keywords.<\/p>\n\n\n\n<p>In the middleware dashboard, when you click on the search bar, you can see a list of options that you can use to search your log queries.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"473\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.8-1024x473.jpg\" alt=\"search your log queries\" class=\"wp-image-5594\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-1024x473.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-300x138.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-768x354.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-1536x709.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-2048x945.jpg 2048w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-1200x554.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.8-1980x914.jpg 1980w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Log monitoring dashboard in Middleware<\/figcaption><\/figure>\n\n\n\n<p>Suppose you select a <em>hostname <\/em>from the above options. Then, you will be presented with a list of <em>hostnames<\/em> to select. You can click on any <em>hostname <\/em>according to your requirement, and all the logs will be arranged according to the selected <em>hostname<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"462\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.9-1024x462.jpg\" alt=\"Filter logs by hostname.\" class=\"wp-image-5595\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.9-1024x462.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.9-300x135.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.9-768x347.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.9-1536x694.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.9-1200x542.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.9.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can also search for the next queries along with other search queries. For example, we searched for the log file name and chose auth.log as a log file name. Similarly, you can search for other log queries and quickly see the results.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"463\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.10-1024x463.jpg\" alt=\"search queries for categories\" class=\"wp-image-5596\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.10-1024x463.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.10-300x136.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.10-768x347.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.10-1536x694.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.10-1200x543.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.10.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Search for specific logs in Middleware using a custom query search functionality.<\/figcaption><\/figure>\n\n\n\n<p>Another thing that you can do is that, if you want to search for the error level live, first select the error level by using the search bar and then click on the live. So all the logs that have some errors will appear live.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"455\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.11-1024x455.jpg\" alt=\"timeline view of Logs\" class=\"wp-image-5597\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.11-1024x455.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.11-300x133.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.11-768x341.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.11-1536x682.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.11-1200x533.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.11.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption><a href=\"https:\/\/app.middleware.io\/auth\/register\/\" target=\"_blank\" rel=\"noreferrer noopener\">A timeline view of logs<\/a><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-save-filters-for-frequent-use-cases\">2. Save filters for frequent use cases<\/h3>\n\n\n\n<p>The save filter option is amazing for frequent use cases. Keeping track of different queries and repeatedly re-entering them can be time-consuming and error-prone. <\/p>\n\n\n\n<p>Middleware has a great feature for saving queries with a name to reduce MTTR and the number of users recalling and re-entering queries manually. You can use this feature each time you search for the same query.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"297\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.12-1024x297.jpg\" alt=\"Save filter for common use case\" class=\"wp-image-5598\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-1024x297.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-300x87.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-768x223.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-1536x446.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-2048x594.jpg 2048w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-1200x348.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.12-1980x574.jpg 1980w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>As you can see in the above image, we first need to search for particular logs. Then, click the Filter Action button and <em>Save to a New Filter<\/em>. You will be asked to give a name and save it.<\/p>\n\n\n\n<p>To use the query again, click on the <em>Blank <\/em>button to see the list of your saved queries. You can access it with just one click. This is how save filters are useful, as they save a lot of time from rewriting the query.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"609\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.13-1024x609.jpg\" alt=\"Choose between filters\" class=\"wp-image-5599\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.13-1024x609.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.13-300x178.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.13-768x456.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.13-1200x713.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.13.jpg 1420w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-easy-interpretation-and-troubleshooting\">3. Easy Interpretation and Troubleshooting<\/h3>\n\n\n\n<p>Many errors can occur, such as failed passwords, disconnected from users, and authentication failures. Log monitoring tools like middleware can help you identify and interpret all of these issues.<\/p>\n\n\n\n<p>Suppose you are searching for an error and want to know how many logs contain the same error. To do this, simply select the text, and two circular buttons will pop up, as you can see below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.14-1024x567.jpg\" alt=\"Add a search filter\" class=\"wp-image-5600\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-1024x567.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-300x166.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-768x425.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-1536x850.jpg 1536w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-2048x1133.jpg 2048w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-1200x664.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.14-1980x1095.jpg 1980w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The (+) button is used to add a message to the search filter. For example, if you have selected the message &#8220;Disconnected from authenticating user root&#8221;, you can click the (+) button to search for all logs containing the same error.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"588\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.15-1024x588.jpg\" alt=\"Filter logs for common errors\" class=\"wp-image-5601\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.15-1024x588.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.15-300x172.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.15-768x441.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.15-1200x689.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.15.jpg 1402w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, to open the log details of any error message, simply select the message and click on the (!) button<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"597\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.16-1024x597.jpg\" alt=\"Open log details of any error message\" class=\"wp-image-5602\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.16-1024x597.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.16-300x175.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.16-768x448.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.16.jpg 1147w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After clicking on the (!) button, the details of the error message will appear. The tags will also appear. Click on the <em>Show in content<\/em> button to see all the messages with these tags.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"564\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.17-1024x564.jpg\" alt=\"error message with logs\" class=\"wp-image-5603\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.17-1024x564.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.17-300x165.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.17-768x423.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.17-1200x661.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.17.jpg 1435w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can easily troubleshoot these error messages, as you will have all the details about the error, such as the <em>log file name<\/em>, the <em>log file path<\/em>, and so on.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"557\" src=\"https:\/\/middleware.io\/backend\/wp-content\/uploads\/2023\/07\/image.18-1024x557.jpg\" alt=\"details of Logs\" class=\"wp-image-5604\" srcset=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.18-1024x557.jpg 1024w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.18-300x163.jpg 300w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.18-768x418.jpg 768w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.18-1200x653.jpg 1200w, https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/image.18.jpg 1414w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>As discussed above, it shows how log searching can be easy with the support of tools like middleware. You can perform many time-consuming tasks effectively and easily. <\/p>\n\n\n\n<div class=\"container-cta small\">\n<h3>Start collecting and monitoring your logs within a minute.<\/h3>\n    \t<a href=\"https:\/\/app.middleware.io\/auth\/register\/\" target=\"_blank\" rel=\"noopener\"><button class=\"primary white\">See it in action<\/button><\/a>\n<\/div>\n\n\n\n<p>Middleware is a good choice for effectively searching logs; it helps you save and reuse search queries for faster troubleshooting, view historical log data with the time travel feature, and improve troubleshooting and problem resolution by providing a more comprehensive view of system and application behavior.<\/p>\n\n\n\n<p>Middleware also allows you to <a href=\"https:\/\/middleware.io\/platform\/alerts\/\">set alert thresholds<\/a> to ensure only relevant alerts are sent. With a single script installation, you can easily obtain your environment&#8217;s 100% logs and store them in your cloud to reduce costs by 10X.<\/p>\n\n\n\n<p><strong>Try middleware today! It&#8217;s free<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Searching for right logs from a pool of logs can be challenging. That&#8217;s where custom query and filtering comes into picture. In this article, we will discover how to search logs effectively using Bash command &#038; using free log management software.<\/p>\n","protected":false},"author":4,"featured_media":5622,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[487],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Search Logs Effectively With Log Management<\/title>\n<meta name=\"description\" content=\"Learn how to search logs effectively using Bash command and by using free log management tools like Middleware.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Search Logs Effectively With Log Management\" \/>\n<meta property=\"og:description\" content=\"Learn how to search logs effectively using Bash command and by using free log management tools like Middleware.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/\" \/>\n<meta property=\"og:site_name\" content=\"Middleware\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-19T12:32:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-01T07:29:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/How-To-Search-Logs-Effectively-With-Log-Management.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1300\" \/>\n\t<meta property=\"og:image:height\" content=\"700\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Meghraj Choudhary\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Meghraj Choudhary\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/\",\"url\":\"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/\",\"name\":\"How To Search Logs Effectively With Log Management\",\"isPartOf\":{\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/#website\"},\"datePublished\":\"2023-07-19T12:32:08+00:00\",\"dateModified\":\"2023-08-01T07:29:28+00:00\",\"author\":{\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/#\/schema\/person\/abb9b5f89051c6190d2256bc01753d93\"},\"description\":\"Learn how to search logs effectively using Bash command and by using free log management tools like Middleware.\",\"breadcrumb\":{\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/stage-site.middleware.io\/ja\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u77e5\u8b58\",\"item\":\"https:\/\/stage-site.middleware.io\/ja\/category\/%e7%9f%a5%e8%ad%98\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Search Logs Effectively With Log Management\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/#website\",\"url\":\"https:\/\/stage-site.middleware.io\/ja\/\",\"name\":\"Middleware\",\"description\":\"Observability platform\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/stage-site.middleware.io\/ja\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/#\/schema\/person\/abb9b5f89051c6190d2256bc01753d93\",\"name\":\"Meghraj Choudhary\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/stage-site.middleware.io\/ja\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d01414151377c6cb34d1a828ce603438?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d01414151377c6cb34d1a828ce603438?s=96&d=mm&r=g\",\"caption\":\"Meghraj Choudhary\"},\"description\":\"With over a decade of experience, Meghraj has significantly contributed to many successful projects. His expertise lies in architecting complex applications and implementing scalable solutions with a focus on performance and efficiency.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/devmraj\/\"],\"url\":\"https:\/\/stage-site.middleware.io\/ja\/author\/meghraj\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Search Logs Effectively With Log Management","description":"Learn how to search logs effectively using Bash command and by using free log management tools like Middleware.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"ja_JP","og_type":"article","og_title":"How To Search Logs Effectively With Log Management","og_description":"Learn how to search logs effectively using Bash command and by using free log management tools like Middleware.","og_url":"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/","og_site_name":"Middleware","article_published_time":"2023-07-19T12:32:08+00:00","article_modified_time":"2023-08-01T07:29:28+00:00","og_image":[{"width":1300,"height":700,"url":"https:\/\/stage-site.middleware.io\/wp-content\/uploads\/2023\/07\/How-To-Search-Logs-Effectively-With-Log-Management.jpg","type":"image\/jpeg"}],"author":"Meghraj Choudhary","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"Meghraj Choudhary","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/","url":"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/","name":"How To Search Logs Effectively With Log Management","isPartOf":{"@id":"https:\/\/stage-site.middleware.io\/ja\/#website"},"datePublished":"2023-07-19T12:32:08+00:00","dateModified":"2023-08-01T07:29:28+00:00","author":{"@id":"https:\/\/stage-site.middleware.io\/ja\/#\/schema\/person\/abb9b5f89051c6190d2256bc01753d93"},"description":"Learn how to search logs effectively using Bash command and by using free log management tools like Middleware.","breadcrumb":{"@id":"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/stage-site.middleware.io\/ja\/search-logs-effectively-with-log-management\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/stage-site.middleware.io\/ja\/"},{"@type":"ListItem","position":2,"name":"\u77e5\u8b58","item":"https:\/\/stage-site.middleware.io\/ja\/category\/%e7%9f%a5%e8%ad%98\/"},{"@type":"ListItem","position":3,"name":"How To Search Logs Effectively With Log Management"}]},{"@type":"WebSite","@id":"https:\/\/stage-site.middleware.io\/ja\/#website","url":"https:\/\/stage-site.middleware.io\/ja\/","name":"Middleware","description":"Observability platform","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stage-site.middleware.io\/ja\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/stage-site.middleware.io\/ja\/#\/schema\/person\/abb9b5f89051c6190d2256bc01753d93","name":"Meghraj Choudhary","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/stage-site.middleware.io\/ja\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d01414151377c6cb34d1a828ce603438?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d01414151377c6cb34d1a828ce603438?s=96&d=mm&r=g","caption":"Meghraj Choudhary"},"description":"With over a decade of experience, Meghraj has significantly contributed to many successful projects. His expertise lies in architecting complex applications and implementing scalable solutions with a focus on performance and efficiency.","sameAs":["https:\/\/www.linkedin.com\/in\/devmraj\/"],"url":"https:\/\/stage-site.middleware.io\/ja\/author\/meghraj\/"}]}},"_links":{"self":[{"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/posts\/5561"}],"collection":[{"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/comments?post=5561"}],"version-history":[{"count":12,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/posts\/5561\/revisions"}],"predecessor-version":[{"id":5694,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/posts\/5561\/revisions\/5694"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/media\/5622"}],"wp:attachment":[{"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/media?parent=5561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/categories?post=5561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stage-site.middleware.io\/ja\/wp-json\/wp\/v2\/tags?post=5561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}