Project

General

Profile

How to setup app » History » Version 7

Luke Murphey, 05/07/2017 12:18 AM

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 1 Luke Murphey
6 1 Luke Murphey
!drive_api.png!
7 1 Luke Murphey
8 7 Luke Murphey
*3.* Click to “IAM and Admin” and select the "Service Accounts"
9 1 Luke Murphey
10 7 Luke Murphey
!select_service_account.png!
11 7 Luke Murphey
12 7 Luke Murphey
*4.* Click "Create Service Account" and select "Furnish a new private key" of type "JSON"
13 7 Luke Murphey
14 7 Luke Murphey
!new_service_account_dialog.png!
15 7 Luke Murphey
16 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.
17 7 Luke Murphey
18 7 Luke Murphey
!new_key.png!
19 1 Luke Murphey
20 1 Luke Murphey
*4.* Complete the form and press create. Your browser will download a JSON file.
21 1 Luke Murphey
22 4 Luke Murphey
*5.* Upload the file to the Google Drive app by clicking "Set up" from within the list of apps of Splunk Manager.
23 1 Luke Murphey
24 5 Luke Murphey
!setup.png!
25 5 Luke Murphey
26 1 Luke Murphey
*6.* 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.
27 1 Luke Murphey
28 1 Luke Murphey
!share_file.png!
29 6 Luke Murphey
30 6 Luke Murphey
Alternatively, you can manually setup the key via the file-system (see below at the bottom of the page for instructions).
31 6 Luke Murphey
32 6 Luke Murphey
h2. Manually configuring the key via file-system
33 6 Luke Murphey
34 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.
35 6 Luke Murphey
36 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+
37 6 Luke Murphey
 
38 6 Luke Murphey
*2.* Create configuration telling the app to use your key
39 6 Luke Murphey
40 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.
41 6 Luke Murphey
42 6 Luke Murphey
Populate this file with the following, substituting your service account key file accordingly:
43 6 Luke Murphey
44 6 Luke Murphey
<pre>
45 6 Luke Murphey
[google_spreadsheet]
46 6 Luke Murphey
disabled = 0
47 6 Luke Murphey
service_account_key_file = myserviceaccountkey-837fa6bc1.json
48 6 Luke Murphey
</pre>
49 6 Luke Murphey
50 6 Luke Murphey
This should result in a file in a location something like this: +/opt/splunk/etc/apps/google_drive/local/inputs.conf+