メインコンテンツまでスキップ
Sumo Logic Japanese

Jira のログの収集

JIRA 用 Sumo Logic アプリケーションのログ収集と JIRA Webhook の設定手順。

このページでは、Jira 用 Sumo アプリケーションの Jira からのログ収集手順を説明します。

Jira アクセス、セキュリティ、Catalina ログ収集のために、3 個のローカル ファイル ソースを使用して Jira ホストのインストール済みコレクタを設定します。また、Jira から Webhook イベントを受信する HTTP ソースを使用して、ホスト型コレクタを設定します。

ステップ 1: インストール済みコレクタでのローカル ファイル ソースのセットアップ

  1. JIRA ホストにコレクタをインストールします。各オペレーティング システム向けの手順は、「インストール済みコレクタ」を参照してください。 
  2. Jira アクセス ログ用コレクタにローカル ファイル ソースを追加します。「ローカル ファイル ソース」のステップと、次の追加の手順に従います。
    • ファイルパス。  Linux の場合、アクセス ログは通常 /var/log/apache2/*.log にあります。
    • Source Category (ソース カテゴリ)jira/access に設定します。
  3. Jira セキュリティ ログ用コレクタにローカル ファイル ソースを追加します。「ローカル ファイル ソース」のステップと、次の追加の手順に従います。
    • ファイルパス。  Linux の場合、セキュリティ ログは通常 /home/jira/atlassian/application-data/jira/log/atlassian-jira-security.log にあります。
    • Source Category (ソース カテゴリ)jira/security に設定します。
  4. Jira Catalina ログ用コレクタにローカル ファイル ソースを追加します。「ローカル ファイル ソース」のステップと、次の追加の手順に従います。
    • ファイルパス。  Linux の場合、Catalina ログは通常 /home/jira/atlassian/application-data/jira/log/*.log にあります。
    • Source Category (ソース カテゴリ)jira/catalina に設定します。

ステップ 2: Webhook 受信用のホスト型コレクタの設定

このステップでは、Jira から Webhook を受信するホスト コレクタを作成し、そこに HTTP ソースをセットアップします。

  1. ホスト型コレクタを設定するか、HTTP ソース用の既存のホスト型コレクタを選択します。
  2. ホスト型コレクタで HTTP ソースを設定します。
    • [Source Category (ソース カテゴリ)] では、jira/events. と指定します。
    • ソースの HTTP アドレスを書き留めます。次のステップで Jira Webhook を設定するときに使用します。

ステップ 3: Jira の Webhook の登録

Jira ヘルプの「Webhooks (Webhook)」の手順に従って、次のイベントの Webhook を登録します。

  • 問題関連:
    • created (作成) (jira:issue_created)
    • updated (更新) (jira:issue_updated)
    • deleted (削除) (jira:issue_deleted)
    • worklog changed (ワークログ変更) (jira:worklog_updated)
  • ユーザ関連:
    • created (作成) (user_created)
    • updated (更新) (user_updated)
    • deleted (削除) (user_deleted)
  • スプリント関連:
    • created (作成) (sprint_created)
    • deleted (削除) (sprint_deleted)
    • updated (更新) (sprint_updated)
    • started (開始) (sprint_started)
    • closed (完了) (sprint_closed)

Webhook を設定するとき、ステップ 2 で作成した HTTP ソースの URL を Webhook のエンドポイントとして入力します。

jira-webhook.png

クエリのサンプル

ユーザ作成

_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

ログ メッセージのサンプル

Jira アクセス

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 問題

{"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"}]}}
  • この記事は役に立ちましたか?