===== Crear estadísticas a partir de los logs de acceso de Jira (Atlassian)===== Vamos a ver lo simple y fácil que es crear unas simples estadisticas de los logs de acceso en el framework Jira de Atlassian, para ello usaremos la aplicación [[https://confluence.atlassian.com/display/ATLAS/JIRA+HTTP+Requests+Log+Analyser|HTTP Requests Log Analyser]]. ==== Apartados de la estadística ==== - Solicitudes entrantes (Gráfica). - Solicitudes entrantes por cada área (Texto) - Top20 de las solicitudes no conocidas. **Documentación** (//JIRA HTTP Requests Log Analyser//): [[https://confluence.atlassian.com/display/ATLAS/JIRA+HTTP+Requests+Log+Analyser]]. **Creamos el directorio /opt/atlassian/accesslog/**. mkdir /opt/atlassian/accesslog/ Descargamos en dicho directorio "[[https://confluence.atlassian.com/display/ATLAS |http Request log analyser"]]. ==== Creación del script ==== Este script agrupará los tres archivos que genera "//JIRA HTTP Requests Log Analyser//" en un solo documento html. Se presupone que los logs de acceso están en la ruta ///opt/atlassian/jira/logs//. #!/bin/bash cd /opt/atlassian/jira/atlassian-jira/report; java -jar /opt/atlassian/accesslog/access-log-analyser-1.1.jar file=/opt/atlassian/jira/logs/access_log.*; echo "





Incoming requests by categories

" > /opt/atlassian/jira/atlassian-jira/report/caca.txt;
cat /opt/atlassian/jira/atlassian-jira/report/request-log-summary.wiki >> /opt/atlassian/jira/atlassian-jira/report/caca.txt;
echo "






TOP 20 Unknown requests.

" >> /opt/atlassian/jira/atlassian-jira/report/caca.txt;
cat /opt/atlassian/jira/atlassian-jira/report/unknown-requests.txt >> /opt/atlassian/jira/atlassian-jira/report/caca.txt;
echo "
" >> /opt/atlassian/jira/atlassian-jira/report/caca.txt; sed '/<\/div>/r /opt/atlassian/jira/atlassian-jira/report/caca.txt' /opt/atlassian/jira/atlassian-jira/report/requests-over-time.html > /opt/atlassian/jira/atlassian-jira/report/index.html; rm -rf /opt/atlassian/jira/atlassian-jira/report/reque* /opt/atlassian/jira/atlassian-jira/report/*.txt; chmod u+x /opt/atlassian/accesslog/jiraloganalyzer.sh
**Creamos una tarea en el cron** (Cada hora de lunes a viernes). 0 * * * 1,2,3,4,5 /opt/atlassian/accesslog/jiraloganalyzer.sh >/dev/null 2>&1