All Apps and Add-ons

Splunk Add-on for Box: How to index additional fields in the user object?

New Member

TLDR- Is the application indexing items other than the events stream?

I'm trying to search some of the "tracking_codes" for users in my Box instance to report on usage by groups, for example "Sales", and this is not being returned in the splunk events. (Tracking codes can be enabled by the Box customer success teams for enterprise customers).

I first edited the box.conf file to add the appropriate user fields:

userfields = type,id,name,login,createdat,modifiedat,role,timezone,spaceamount,spaceused,maxuploadsize,canseemanagedusers,isexternalcollabrestricted,status,jobtitle,phone,address,avatarurl,isexemptfromdevicelimits,isexemptfromlogin_verification,tracking_codes,enterprise,my_tags

I created a new user in Box with tracking codes set:

{
"type": "user",
"id": "240685827",
"name": "Danno Tracking Code Test",
"login": "doleary+XXXX@x.com",
"createdat": "2015-06-23T11:00:33-07:00",
"modified
at": "2015-06-23T11:10:44-07:00",
"language": "en",
"timezone": "America\/LosAngeles",
"space
amount": 1000000000000000,
"spaceused": 1255288,
"max
uploadsize": 16106127360,
"status": "active",
"job
title": "",
"phone": "",
"address": "",
"avatar_url": "https:\/\/FOOOO.app.box.com\/api\/avatar\/large\/240685827"
}

When I add the "fields" parameter with "tracking_codes", it returns:

{
"type": "user",
"id": "24068NNNN",
"trackingcodes": [
{
"type": "tracking
code",
"name": "Sales",
"value": "Field Team"
},
{
"type": "trackingcode",
"name": "Finance",
"value": "2300"
},
{
"type": "tracking
code",
"name": "APAC",
"value": "Bravo"
}
]
}

In Splunk however, I think that these optional fields aren't being indexed: You can see that the sourcetype is box:events

Per the Box documentation, at https://developers.box.com/docs/#fields

Fields Support: The fields parameter
is not yet supported for GET /events,
POST /files/content, and POST
/files/{id}/content.

Question- since some of these optional fields are set and appear to be in use, how do we get them indexed?

0 Karma

Splunk Employee
Splunk Employee

By default, the Box Add-on is designed to support dynamical fields query for Box user information. So for your case, after you editting box.conf to add the new fields "trackingcode" to the "userfields" and if Box API responses with trackingcode then you should be able to get the trackingcode indexed into Splunk.

In order to verify this. please do the followings:
1) enable the log level to DEBUG
2) check the tabox.log to see the REST request sent to Box for user information. Make sure the "trackingcode" is in the request URL.
3) Run "curl" against the URL which has "trackingcode" to verify the "trackingcode" is responded by Box. The curl command will be something like this:
curl https://api.box.com/2.0/users? fields=type,id,name,login,createdat,modifiedat,role,timezone,spaceamount,spaceused,maxuploadsize,canseemanagedusers, isexternalcollabrestricted,status,jobtitle,phone,address,avatarurl,isexemptfromdevicelimits,isexemptfromloginverification,enterprise,mytags,trackingcode -H "Authorization: Bearer ACCESS_TOKEN"

Note: by default box user is scheduled to run every 7 days. So once the box user info has been indexed, they will not be indexed again until the expiration. You can change the interval of the data collection to a small one through data inputs to make you changes effective in a small amount of time.

Splunk Employee
Splunk Employee

Hi,

your best route to getting a feature added is to file an enhancement request through support.

0 Karma