in layershift go to the top link IMPORT


import manifest from - https://raw.githubusercontent.com/jelastic-jps/fail2ban/master/manifest.jps


change jail.conf to correct log files





//IF ON TOMCAT you need to ensure the local-access-log includes the x-forward-for.


To do this edit the server.xml. After the host entry add



                <Valve className="org.apache.catalina.valves.RemoteIpValve"

           remoteIpHeader="x-forwarded-for" 

           protocolHeader="x-forwarded-proto" />


and append the accessLogValve to 


     

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

               prefix="localhost_access_log" suffix=".txt" renameOnRotate="true"

               pattern="%{x-forwarded-for}i - %h %l %u %t &quot;%r&quot; %s %b %I "/>


lastly in jail.conf - point the ssh-iptables to the tomcat loacal-access.log