Skip to main content
Sumo Logic

Collect Logs for Jira

Instructions for configuring log collection and JIRA webhooks for the Sumo Logic App for JIRA.

This page has instructions for collecting logs from Jira for the Sumo App for Jira.

You will configure an installed collector on your Jira host with three local file sources, for collecting Jira access, security, and catalina logs. You also configure a hosted collector with an HTTP source for receiving webhook events from Jira.

Step 1: Set up local file sources on an installed collector

  1. Install a collector on the JIRA host. You can find the instructions for your operating system on Installed Collectors
  2. Add a local file source to the collector for Jira access logs. Follow the steps on Local File Source, with these additional instructions:
    • Filepath.  On Linux, access logs are typically found in /var/log/apache2/*.log.
    • Source Category. Set to jira/access.
  3. Add a local file source to the collector for Jira security logs. Follow the steps on Local File Source, with these additional instructions:
    • Filepath.  On Linux, security logs are typically found in /home/jira/atlassian/application-data/jira/log/atlassian-jira-security.log.
    • Source Category. Set to jira/security.
  4. Add a local file source to the collector for Jira Catalina logs. Follow the steps on Local File Source, with these additional instructions:
    • Filepath.  On Linux, Catalina logs are typically found in /home/jira/atlassian/application-data/jira/log/*.log.
    • Source Category. Set to jira/catalina.

Step 2: Configure hosted collector to receive webhooks

In this step, you create a host collector to receive webhooks from Jira, and set up an HTTP source on it.

  1. Configure a hosted collector, or select an existing hosted collector for the HTTP source.
  2. Configure an HTTP source on the hosted collector.
    • For Source Category, specify jira/events.
    • Make a note of the HTTP address for the source. You will supply it when you configure a Jira webhook in the next step.

Step 3: Register webhook in Jira

Follow the instructions on Webhooks in Jira help to register a webhook for the following events:

  • Issue related:
    • created (jira:issue_created)
    • updated (jira:issue_updated)
    • deleted (jira:issue_deleted)
    • worklog changed (jira:worklog_updated)
  • User related:
    • created (user_created)
    • updated (user_updated)
    • deleted (user_deleted)
  • Sprint related:
    • created (sprint_created)
    • deleted (sprint_deleted)
    • updated (sprint_updated)
    • started (sprint_started)
    • closed (sprint_closed)

When you configure the webhook, enter the URL for the HTTP source you created in step 2 as the endpoint for the webhook.

jira-webhook.png

Sample query

Users created

_sourceCategory=Jira/events (user_created or user_deleted or user_updated)
| json  "webhookEvent", "user.emailAddress", "user.displayName", "user.name", "timestamp" as event_name, user_email, user_name, user, timestamp nodrop
| where event_name ="user_created" 
| formatDate(fromMillis(timestamp), "MM-dd-yyyy HH:mm:ss") as date_time
| count by date_time, user_email, user_name
| fields - _count
| sort by date_time desc

Sample log messages

Jira Access

10.189.181.31 - qe@abc.com [24/Sep/2018:13:31:05 -0700] "POST /testrail/index.php?/api/v2/add_result_for_case/253843/13308563 HTTP/1.1" 200 426 "-" "Go-http-client/1.1"

Jira Catalina

24-Sep-2018 13:31:11.370 WARNING [ajp-nio-8009-exec-973] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI https://jira.shoporg.com/jira/rest/b...sitory/60/sync, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.

Jira Issue


{"timestamp":1537732077661,"webhookEvent":"jira:issue_updated","issue_event_type_name":"issue_closed","user":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/user?username=german","name":"german","key":"german","emailAddress":"randa@ShopperOrg.com","avatarUrls":{"48x48":"https://jira.ShopperOrg.com/jira/secure/useravatar?ownerId=german&avatarId=10823","24x24":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=small&ownerId=german&avatarId=10823","16x16":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=xsmall&ownerId=german&avatarId=10823","32x32":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=medium&ownerId=german&avatarId=10823"},"displayName":"German Borbolla Flores","active":true,"timeZone":"America/Los_Angeles"},"issue":{"id":"816890","self":"https://jira.ShopperOrg.com/jira/rest/api/2/issue/816890","key":"SUMO-96260","fields":{"issuetype":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/issuetype/23","id":"23","description":"A required change for production","iconUrl":"https://jira.ShopperOrg.com/jira/images/icons/issuetypes/documentation.png","name":"System Change","subtask":false},"customfield_13260":null,"customfield_11360":"0.0","timespent":null,"customfield_13661":null,"customfield_13660":null,"project":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/project/10000","id":"10000","key":"SUMO","name":"Shopper Org","avatarUrls":{"48x48":"https://jira.ShopperOrg.com/jira/secure/projectavatar?pid=10000&avatarId=11420","24x24":"https://jira.ShopperOrg.com/jira/secure/projectavatar?size=small&pid=10000&avatarId=11420","16x16":"https://jira.ShopperOrg.com/jira/secure/projectavatar?size=xsmall&pid=10000&avatarId=11420","32x32":"https://jira.ShopperOrg.com/jira/secure/projectavatar?size=medium&pid=10000&avatarId=11420"}},"customfield_11760":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11331","value":"false","id":"11331"},"customfield_13663":null,"customfield_13861":null,"customfield_13662":null,"customfield_11762":[{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11351","value":"Long","id":"11351"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11352","value":"Syd","id":"11352"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11434","value":"Dub","id":"11434"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/12935","value":"Fra","id":"12935"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11350","value":"Prod","id":"11350"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11645","value":"US2","id":"11645"}],"aggregatetimespent":null,"resolution":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/resolution/1","id":"1","description":".","name":"Fixed"},"customfield_10871":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/12736","value":"Out of Window (SOP)","id":"12736"},"customfield_13664":null,"customfield_10872":"Done before","customfield_11763":[{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11353","value":"Long","id":"11353"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11354","value":"Syd","id":"11354"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11433","value":"Dub","id":"11433"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/12936","value":"Fra","id":"12936"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11355","value":"Prod","id":"11355"},{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/11646","value":"US2","id":"11646"}],"customfield_10873":"","resolutiondate":"2018-09-23T12:47:57.606-0700","workratio":-1,"lastViewed":"2018-09-23T12:47:57.591-0700","watches":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/issue/SUMO-96260/watchers","watchCount":0,"isWatching":false},"customfield_12480":"9223372036854775807","customfield_12160":null,"created":"2018-09-20T11:14:03.000-0700","customfield_12283":null,"customfield_12561":"9223372036854775807","customfield_11670":null,"customfield_12164":null,"customfield_10460":null,"customfield_12560":"9223372036854775807","customfield_12288":"N/a","customfield_11671":"2018-09-20","customfield_12961":"0|o01keg:","customfield_12960":"1|zo09v4:","customfield_12963":"0|i0jru7:","customfield_12566":"9223372036854775807","labels":[],"customfield_12962":"0|i0jru7:","customfield_11668":"false","timeestimate":null,"aggregatetimeoriginalestimate":null,"issuelinks":[],"assignee":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/user?username=german","name":"german","key":"german","emailAddress":"randa@ShopperOrg.com","avatarUrls":{"48x48":"https://jira.ShopperOrg.com/jira/secure/useravatar?ownerId=german&avatarId=10823","24x24":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=small&ownerId=german&avatarId=10823","16x16":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=xsmall&ownerId=german&avatarId=10823","32x32":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=medium&ownerId=german&avatarId=10823"},"displayName":"German Borbolla Flores","active":true,"timeZone":"America/Los_Angeles"},"updated":"2018-09-23T12:47:57.653-0700","status":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/status/6","description":"The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.","iconUrl":"https://jira.ShopperOrg.com/jira/images/icons/statuses/closed.png","name":"Closed","id":"6","statusCategory":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/statuscategory/3","id":3,"key":"done","colorName":"green","name":"Done"}},"components":[],"customfield_12070":" ","customfield_13360":null,"timeoriginalestimate":null,"description":"","customfield_11462":"Data flows","customfield_12479":"9223372036854775807","customfield_12478":null,"timetracking":{},"attachment":[],"aggregatetimeestimate":null,"summary":"","creator":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/user?username=german","name":"german","key":"german","emailAddress":"randa@ShopperOrg.com","avatarUrls":{"48x48":"https://jira.ShopperOrg.com/jira/secure/useravatar?ownerId=german&avatarId=10823","24x24":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=small&ownerId=german&avatarId=10823","16x16":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=xsmall&ownerId=german&avatarId=10823","32x32":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=medium&ownerId=german&avatarId=10823"},"displayName":"German Borbolla Flores","active":true,"timeZone":"America/Los_Angeles"},"customfield_12260":null,"customfield_11170":null,"subtasks":[],"customfield_12262":null,"customfield_12261":null,"customfield_12066":null,"customfield_12065":null,"customfield_10042":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/10022","value":"Nite","id":"10022"},"reporter":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/user?username=german","name":"german","key":"german","emailAddress":"randa@ShopperOrg.com","avatarUrls":{"48x48":"https://jira.ShopperOrg.com/jira/secure/useravatar?ownerId=german&avatarId=10823","24x24":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=small&ownerId=german&avatarId=10823","16x16":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=xsmall&ownerId=german&avatarId=10823","32x32":"https://jira.ShopperOrg.com/jira/secure/useravatar?size=medium&ownerId=german&avatarId=10823"},"displayName":"German Borbolla Flores","active":true,"timeZone":"America/Los_Angeles"},"customfield_10560":"9223372036854775807","customfield_12067":null,"aggregateprogress":{"progress":0,"total":0},"customfield_12268":null,"customfield_10760":null,"customfield_10002":null,"customfield_10960":3.0,"customfield_10874":"N/aD","customfield_10875":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/customFieldOption/10486","value":"Low","id":"10486"},"customfield_10876":"SOP","progress":{"progress":0,"total":0},"comment":{"comments":[],"maxResults":0,"total":0,"startAt":0},"votes":{"self":"https://jira.ShopperOrg.com/jira/rest/api/2/issue/SUMO-96260/votes","votes":0,"hasVoted":false}}},"changelog":{"id":"1113666","items":[{"field":"status","fieldtype":"jira","from":"10019","fromString":"Implemented","to":"6","toString":"Closed"},{"field":"resolution","fieldtype":"jira","from":null,"fromString":null,"to":"1","toString":"Fixed"}]}}