Project

General

Profile

How to setup app » History » Version 8

Luke Murphey, 11/27/2019 05:36 PM

1 3 Luke Murphey
h1. How to setup the Google Drive app with a service account key
2 1 Luke Murphey
3 1 Luke Murphey
*1.* Go to the "Google Developers Console":https://console.developers.google.com/project and create a new project or select an existing one. Click the project to edit the settings for that project.
4 1 Luke Murphey
*2.* Go to “API Manager” and enable the "Drive API"
5 8 Luke Murphey
*3.* Go to “API Manager” and enable the "Google Sheets API"
6 1 Luke Murphey
7 1 Luke Murphey
!drive_api.png!
8 1 Luke Murphey
9 8 Luke Murphey
*4.* Click to “IAM and Admin” and select the "Service Accounts"
10 1 Luke Murphey
11 1 Luke Murphey
!select_service_account.png!
12 7 Luke Murphey
13 8 Luke Murphey
*5.* Click "Create Service Account" and select "Furnish a new private key" of type "JSON"
14 7 Luke Murphey
15 7 Luke Murphey
!new_service_account_dialog.png!
16 7 Luke Murphey
17 7 Luke Murphey
If you want to use an existing account, create a new key for the existing account. Make sure it is a JSON key.
18 1 Luke Murphey
19 1 Luke Murphey
!new_key.png!
20 1 Luke Murphey
21 8 Luke Murphey
*6.* Complete the form and press create. Your browser will download a JSON file.
22 1 Luke Murphey
23 8 Luke Murphey
*7.* Upload the file to the Google Drive app by clicking "Set up" from within the list of apps of Splunk Manager.
24 1 Luke Murphey
25 5 Luke Murphey
!setup.png!
26 5 Luke Murphey
27 8 Luke Murphey
*8.* Share the files in "drive.google.com":http://drive.google.com that you want the Google Drive app to read or edit with the email address specified in the service account. You can do this on a per-file basis or you can share an entire directory to avoid setting individual files.
28 1 Luke Murphey
29 1 Luke Murphey
!share_file.png!
30 6 Luke Murphey
31 6 Luke Murphey
Alternatively, you can manually setup the key via the file-system (see below at the bottom of the page for instructions).
32 6 Luke Murphey
33 6 Luke Murphey
h2. Manually configuring the key via file-system
34 6 Luke Murphey
35 6 Luke Murphey
*1.* Upload your service account key to the following path: +$SPLUNK_HOME/etc/apps/google_drive/service_account_keys+. You will have to create the "service_account_keys" directory if it doesn't exist.
36 6 Luke Murphey
37 6 Luke Murphey
This should result in a file in a location something like this: +/opt/splunk/etc/apps/google_drive/service_account_keys/myserviceaccountkey-837fa6bc1.json+
38 6 Luke Murphey
 
39 6 Luke Murphey
*2.* Create configuration telling the app to use your key
40 6 Luke Murphey
41 6 Luke Murphey
Go to your Splunk install and open the following path: +$SPLUNK_HOME/etc/apps/google_drive/local/inputs.conf+. You may have to create the "local" directory if it doesn't exist.
42 6 Luke Murphey
43 6 Luke Murphey
Populate this file with the following, substituting your service account key file accordingly:
44 6 Luke Murphey
45 6 Luke Murphey
<pre>
46 6 Luke Murphey
[google_spreadsheet]
47 6 Luke Murphey
disabled = 0
48 6 Luke Murphey
service_account_key_file = myserviceaccountkey-837fa6bc1.json
49 6 Luke Murphey
</pre>
50 6 Luke Murphey
51 6 Luke Murphey
This should result in a file in a location something like this: +/opt/splunk/etc/apps/google_drive/local/inputs.conf+