revising log files [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-3
down vote

favorite












I am checking the log on a server multiple times throughout the day. Each time, I open the log in NotePad++ and search for key words such as "warn" or "error" and then review the error or warning to determine my next course of action. Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?










share|improve this question















closed as unclear what you're asking by Jeff Schaller, dr01, Romeo Ninov, Rui F Ribeiro, RalfFriedl Sep 13 at 16:48


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • would you please provide an example of the log file! and the commands you used
    – Goro
    Sep 13 at 13:58










  • Not clear what you're asking.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:00










  • Can you just use grep to find lines containing the warning error keywords? If you're using a more complex log format, you need to describe it. Then people can give you a sed or Python based script.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:14














up vote
-3
down vote

favorite












I am checking the log on a server multiple times throughout the day. Each time, I open the log in NotePad++ and search for key words such as "warn" or "error" and then review the error or warning to determine my next course of action. Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?










share|improve this question















closed as unclear what you're asking by Jeff Schaller, dr01, Romeo Ninov, Rui F Ribeiro, RalfFriedl Sep 13 at 16:48


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • would you please provide an example of the log file! and the commands you used
    – Goro
    Sep 13 at 13:58










  • Not clear what you're asking.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:00










  • Can you just use grep to find lines containing the warning error keywords? If you're using a more complex log format, you need to describe it. Then people can give you a sed or Python based script.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:14












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I am checking the log on a server multiple times throughout the day. Each time, I open the log in NotePad++ and search for key words such as "warn" or "error" and then review the error or warning to determine my next course of action. Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?










share|improve this question















I am checking the log on a server multiple times throughout the day. Each time, I open the log in NotePad++ and search for key words such as "warn" or "error" and then review the error or warning to determine my next course of action. Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?







logs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 13 at 14:33









Rui F Ribeiro

36.8k1273117




36.8k1273117










asked Sep 13 at 13:56









rmille05

63




63




closed as unclear what you're asking by Jeff Schaller, dr01, Romeo Ninov, Rui F Ribeiro, RalfFriedl Sep 13 at 16:48


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Jeff Schaller, dr01, Romeo Ninov, Rui F Ribeiro, RalfFriedl Sep 13 at 16:48


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • would you please provide an example of the log file! and the commands you used
    – Goro
    Sep 13 at 13:58










  • Not clear what you're asking.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:00










  • Can you just use grep to find lines containing the warning error keywords? If you're using a more complex log format, you need to describe it. Then people can give you a sed or Python based script.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:14
















  • would you please provide an example of the log file! and the commands you used
    – Goro
    Sep 13 at 13:58










  • Not clear what you're asking.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:00










  • Can you just use grep to find lines containing the warning error keywords? If you're using a more complex log format, you need to describe it. Then people can give you a sed or Python based script.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 14:14















would you please provide an example of the log file! and the commands you used
– Goro
Sep 13 at 13:58




would you please provide an example of the log file! and the commands you used
– Goro
Sep 13 at 13:58












Not clear what you're asking.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 13 at 14:00




Not clear what you're asking.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 13 at 14:00












Can you just use grep to find lines containing the warning error keywords? If you're using a more complex log format, you need to describe it. Then people can give you a sed or Python based script.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 13 at 14:14




Can you just use grep to find lines containing the warning error keywords? If you're using a more complex log format, you need to describe it. Then people can give you a sed or Python based script.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 13 at 14:14










1 Answer
1






active

oldest

votes

















up vote
-1
down vote



accepted










using CRON or AT you can set up a schedule to run a script or program according to any desired schedule such as at specific times repeated every day or once per week.



Look up linux CRON, and crontab -e



as well as linux AT https://linux.die.net/man/1/at



As for a script or program to be run, that would be up to you to implement. Does not need to be complex, simply do a word search within specific log file, if found then do something.



that something can be send an email saying found, or just create a text file with either "NOT FOUND" or "FOUND with detail"



you would want to learn BASH shell scripting.



first thing that comes to mind is in linux grep -l "word_pattern" filename



if the grep command does not find your word pattern within the file, then it returns nothing and that can be used within a BASH shell script as your not found condition.






share|improve this answer




















  • Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
    – rmille05
    Sep 13 at 14:32










  • you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
    – ron
    Sep 13 at 14:42

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
-1
down vote



accepted










using CRON or AT you can set up a schedule to run a script or program according to any desired schedule such as at specific times repeated every day or once per week.



Look up linux CRON, and crontab -e



as well as linux AT https://linux.die.net/man/1/at



As for a script or program to be run, that would be up to you to implement. Does not need to be complex, simply do a word search within specific log file, if found then do something.



that something can be send an email saying found, or just create a text file with either "NOT FOUND" or "FOUND with detail"



you would want to learn BASH shell scripting.



first thing that comes to mind is in linux grep -l "word_pattern" filename



if the grep command does not find your word pattern within the file, then it returns nothing and that can be used within a BASH shell script as your not found condition.






share|improve this answer




















  • Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
    – rmille05
    Sep 13 at 14:32










  • you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
    – ron
    Sep 13 at 14:42














up vote
-1
down vote



accepted










using CRON or AT you can set up a schedule to run a script or program according to any desired schedule such as at specific times repeated every day or once per week.



Look up linux CRON, and crontab -e



as well as linux AT https://linux.die.net/man/1/at



As for a script or program to be run, that would be up to you to implement. Does not need to be complex, simply do a word search within specific log file, if found then do something.



that something can be send an email saying found, or just create a text file with either "NOT FOUND" or "FOUND with detail"



you would want to learn BASH shell scripting.



first thing that comes to mind is in linux grep -l "word_pattern" filename



if the grep command does not find your word pattern within the file, then it returns nothing and that can be used within a BASH shell script as your not found condition.






share|improve this answer




















  • Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
    – rmille05
    Sep 13 at 14:32










  • you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
    – ron
    Sep 13 at 14:42












up vote
-1
down vote



accepted







up vote
-1
down vote



accepted






using CRON or AT you can set up a schedule to run a script or program according to any desired schedule such as at specific times repeated every day or once per week.



Look up linux CRON, and crontab -e



as well as linux AT https://linux.die.net/man/1/at



As for a script or program to be run, that would be up to you to implement. Does not need to be complex, simply do a word search within specific log file, if found then do something.



that something can be send an email saying found, or just create a text file with either "NOT FOUND" or "FOUND with detail"



you would want to learn BASH shell scripting.



first thing that comes to mind is in linux grep -l "word_pattern" filename



if the grep command does not find your word pattern within the file, then it returns nothing and that can be used within a BASH shell script as your not found condition.






share|improve this answer












using CRON or AT you can set up a schedule to run a script or program according to any desired schedule such as at specific times repeated every day or once per week.



Look up linux CRON, and crontab -e



as well as linux AT https://linux.die.net/man/1/at



As for a script or program to be run, that would be up to you to implement. Does not need to be complex, simply do a word search within specific log file, if found then do something.



that something can be send an email saying found, or just create a text file with either "NOT FOUND" or "FOUND with detail"



you would want to learn BASH shell scripting.



first thing that comes to mind is in linux grep -l "word_pattern" filename



if the grep command does not find your word pattern within the file, then it returns nothing and that can be used within a BASH shell script as your not found condition.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 13 at 14:23









ron

8131614




8131614











  • Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
    – rmille05
    Sep 13 at 14:32










  • you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
    – ron
    Sep 13 at 14:42
















  • Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
    – rmille05
    Sep 13 at 14:32










  • you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
    – ron
    Sep 13 at 14:42















Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
– rmille05
Sep 13 at 14:32




Thank you. That was very helpful. I apologize as I should clarify that my attempt was to use BASH and make it as basic as possible. I was asked if I could write a bash script that would check the log for errors, and return a well-defined error message (if there were errors). Then another team could call that script using one of their other monitoring agents, and alert based on that. I don't know if that helps or makes any sense.
– rmille05
Sep 13 at 14:32












you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
– ron
Sep 13 at 14:42




you were fine with " Instead of checking it multiple times a day, is there a way to run a script to check the log for errors or warnings?". If people are going to be so high strung to flag and down vote questions like this then just close down this Unix section.
– ron
Sep 13 at 14:42


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay