Project

General

Profile

How to setup app » History » Version 6

Luke Murphey, 08/09/2016 05:36 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 1 Luke Murphey
*3.* Go to “API Manager” and enable the "Drive API"
9 1 Luke Murphey
10 1 Luke Murphey
!service_account_key.png!
11 1 Luke Murphey
12 1 Luke Murphey
*4.* Complete the form and press create. Your browser will download a JSON file.
13 1 Luke Murphey
14 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.
15 1 Luke Murphey
16 5 Luke Murphey
!setup.png!
17 5 Luke Murphey
18 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.
19 1 Luke Murphey
20 1 Luke Murphey
!share_file.png!
21 6 Luke Murphey
22 6 Luke Murphey
Alternatively, you can manually setup the key via the file-system (see below at the bottom of the page for instructions).
23 6 Luke Murphey
24 6 Luke Murphey
h2. Manually configuring the key via file-system
25 6 Luke Murphey
26 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.
27 6 Luke Murphey
28 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+
29 6 Luke Murphey
 
30 6 Luke Murphey
*2.* Create configuration telling the app to use your key
31 6 Luke Murphey
32 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.
33 6 Luke Murphey
34 6 Luke Murphey
Populate this file with the following, substituting your service account key file accordingly:
35 6 Luke Murphey
36 6 Luke Murphey
<pre>
37 6 Luke Murphey
[google_spreadsheet]
38 6 Luke Murphey
disabled = 0
39 6 Luke Murphey
service_account_key_file = myserviceaccountkey-837fa6bc1.json
40 6 Luke Murphey
</pre>
41 6 Luke Murphey
42 6 Luke Murphey
This should result in a file in a location something like this: +/opt/splunk/etc/apps/google_drive/local/inputs.conf+