Bash script to watch a log file and react to help catch form spam

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











up vote
0
down vote

favorite












I found your post on SO Best way to follow a log and execute a command when some text appears in the log



You are at the very bottom of the post where you made it readable and that makes sense (to some degree) I get it as a concept...



I have a PHP form processor. It's integrated into a few hundred websites and multiple forms on websites. I have done a lot of user-friendly spam catching etc for these forms but as we all know it's painful.



How can I use the post above to say count the number of times a certain IP Address filled out a form. ie. this IP has filled out Xnum forms in X seconds, it's a robot, ban this IP via iptables and record this to a different log so we can expire them based on a date-time in that log. Sort of a general idea and I'm sure there are many solutions, but I don't have one. Any suggestions would be very much appreciated. - Thanks in Advance










share|improve this question







New contributor




Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I found your post on SO Best way to follow a log and execute a command when some text appears in the log



    You are at the very bottom of the post where you made it readable and that makes sense (to some degree) I get it as a concept...



    I have a PHP form processor. It's integrated into a few hundred websites and multiple forms on websites. I have done a lot of user-friendly spam catching etc for these forms but as we all know it's painful.



    How can I use the post above to say count the number of times a certain IP Address filled out a form. ie. this IP has filled out Xnum forms in X seconds, it's a robot, ban this IP via iptables and record this to a different log so we can expire them based on a date-time in that log. Sort of a general idea and I'm sure there are many solutions, but I don't have one. Any suggestions would be very much appreciated. - Thanks in Advance










    share|improve this question







    New contributor




    Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I found your post on SO Best way to follow a log and execute a command when some text appears in the log



      You are at the very bottom of the post where you made it readable and that makes sense (to some degree) I get it as a concept...



      I have a PHP form processor. It's integrated into a few hundred websites and multiple forms on websites. I have done a lot of user-friendly spam catching etc for these forms but as we all know it's painful.



      How can I use the post above to say count the number of times a certain IP Address filled out a form. ie. this IP has filled out Xnum forms in X seconds, it's a robot, ban this IP via iptables and record this to a different log so we can expire them based on a date-time in that log. Sort of a general idea and I'm sure there are many solutions, but I don't have one. Any suggestions would be very much appreciated. - Thanks in Advance










      share|improve this question







      New contributor




      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I found your post on SO Best way to follow a log and execute a command when some text appears in the log



      You are at the very bottom of the post where you made it readable and that makes sense (to some degree) I get it as a concept...



      I have a PHP form processor. It's integrated into a few hundred websites and multiple forms on websites. I have done a lot of user-friendly spam catching etc for these forms but as we all know it's painful.



      How can I use the post above to say count the number of times a certain IP Address filled out a form. ie. this IP has filled out Xnum forms in X seconds, it's a robot, ban this IP via iptables and record this to a different log so we can expire them based on a date-time in that log. Sort of a general idea and I'm sure there are many solutions, but I don't have one. Any suggestions would be very much appreciated. - Thanks in Advance







      linux bash centos






      share|improve this question







      New contributor




      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 16 mins ago









      Scott Thompson

      1




      1




      New contributor




      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Scott Thompson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Scott Thompson is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476173%2fbash-script-to-watch-a-log-file-and-react-to-help-catch-form-spam%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Scott Thompson is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Scott Thompson is a new contributor. Be nice, and check out our Code of Conduct.












          Scott Thompson is a new contributor. Be nice, and check out our Code of Conduct.











          Scott Thompson is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476173%2fbash-script-to-watch-a-log-file-and-react-to-help-catch-form-spam%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?