EDIT: 20-April-2016: About 2.5 years ago I warned you that that they could go away….Well, in 9.3, they went away in a default configuration of the Server. Sorry. More info here, but you probably don’t want to use these techniques any more: http://kb.tableau.com/articles/knowledgebase/xml-endpoints-no-longer-available
Good morning, campers. Lets get right into the continuing story of the Tableau XML files. By now you should:
- Have a basic understanding around the use of these files
- Know how to request them
Now, we’ll dive into the information contained in each one. We’re only covering the “most popular”. There are many more – up to you to find them!
First, some expectation setting: In some cases, you’re going to see that a particular file might not contain everything you want it to.
Indeed, you might just be tempted to ask for some additional fields to make your life easier. Please keep in mind dear reader; these files were not designed for you nor are they intended to be consumed by you. So, you’ll eat what you’re served and like it.
data_connections.xml lists, you guessed it…the data connections inside all your workbooks. To be clear, these are NOT data sources themselves, but (pretty much) the connection strings inside your data sources.
As you can see, there’s some interesting stuff here. The file specifies our data source type (msolap = SQL Server Analysis Services), the server name (“sql”), as well as the internal and friendly name (“name” and “caption”) of the data source. If a username were specified for this data connection, we’d get that, too.
Here’s the same item directly in the application server:
Almost forgot to mention this…note the embedded <owner> element in the XML file definition of the connection. It is pointing to the Datasource that this connection is a part of.
That said, lets look at the Data Source:
All sorts of fun stuff here!
I’ve expanded the information for two data sources above. Pay close attention to the second expanded data source – it’s the parent of the connection we were just looking at – note the matching id (52).
- Id: internal id of the data source
- Name: Name of the data source
- Repository-url: The URL of the object if one were to retrieve it directly
- Owner_id: The site-specific user id of the person who published and owns this data source
- Tasks: Tasks / schedules associated with this data source
On to groups!
This file is pretty cut and dry. We’re going to get a group name, it’s domain and an ID. The domain will read “local” when we’re in standard mode, or will have an actual AD Domain if we’re running in AD mode. Nothing else to see here, move along.
Projects? Not super exciting, either.
Below you’ll see pretty much what you expect:
- The name and ID of the project
- When it was created and if/when it has been modified
- Owner information
Good stuff here.
You can get at pretty much everything you might need to know about your schedules, including the last time one ran (updated-at) and the next time it will run (run-next-at). The one thing you don’t get “out of the box” is whether or not the last execution succeeded or failed – that would be nice.
There is worthwhile information inside sites.xml, as well.
To me, the main standout fields are user_quota and storage quota. Note that the SkunkWorks site is limited to 10 users and 500 GB of storage.
What is the content_admin_mode element telling us about? It represents this part of the Tableau Server UI:
- 1 = Only system admin can add users
- 2 – Both system and site administrators can
Below, you can see the subscription id and subject, as well as information about the user who subscribed. The schedule associated with this subscription is also a part of the hierarchy.
Task information encompasses:
- The id of the task
- What it does (type)
- What object the task acts on (id 701, a workbook named “Google Analytics”
- When the action will occur (schedule)
Users.xml is another file which is content-rich.
- id: the site-specific user id of this person
- luid: ignore. A more unique way to express the user id not useful in the “corp” product
- name: the username in domainuser format
- login_at: last login
- email: duh.
- licensing_level: Interactor, Viewer, or Unlicensed
- administrator: true or false
- admin_type: <empty>, system, or content
- publisher: true or false
- raw_data_suppressor: used by other products, always returns false here.
If the specific user you’re dealing with owns any views, you’ll see them in the views collection of your user. In fact, if someone has added a tag to a view, that’ll show up, too (we won’t cover that yet, though).
This is one of my favorites. A query against /users/<username>.xml will return basic information about the user and a list of workbooks, views and data sources they own.
For example, grab the file for Barney Rubble (username=rubble):
…which results in:
Using this file is a great way to very quickly understand if this user is easily “delete-able” from Tableau Server, or if you need to unlicense them (since they own stuff) instead.
The output of views.xml is arguably the most complex text you’ll work with. There’s tons going on. First, request it:
Note at the top of the file you’re told how many views we’ll be dealing with:
Open one of these elements, and behold the goodness!
As you can see, if a view has tags associated with it, an extra <tags> collection element is added to the view node:
In the sample above you can see someone added a very boring tag (literally, it IS boring. the text is “tag”) in a specific site at a specific point in time. If this view had multiple tags, they’d show up as individual tag elements inside the tags collection.
Interested in the tags created by a user? Grab the /tags.xml file…but you’ll need to figure that one out on your own
views.xml ALSO will show you comments associated with a view in much the same way tags are documented.
And the cornucopia continues to overflow. Want to know if there are customized views floating around?
We gotcha covered…
Note that ALL customized views associated with this sheet are being enumerated, not just the ones I (I am user id 5) created. In the screenshot below I am logged in as “Russell” and I only see the single customized view I created…yet the list above shows two:
Sheesh, I’m glad this is mostly done. I’m getting tired of writing. Anyway, workbooks.xml is pretty much what you’d expect.
It contains elements we’ve already seen like the <view>, <owner>, <task>, and so on:
An interesting element above is <size>. It is used to record the size of the workbook including any associated extract.
Extra credit fun stuff
You can apply filters to many of these files right on the query string to amaze and impress your friends.
I’m not going to cover every single one of these since I’d like YOU to explore yourself. Maybe you’ll find something cool and post it back here.
Here’s a starter list:
Show me all users in a specific group:
(filter “fe_group” by a specific group, in this case “Big Group Three” in the local domain: localBig Group Three)
Give me all workbooks modified after 1-Dec:
Which workbooks does user “Barney Rubble” (user 4408) own?:
Which data connections on my server utilizes Microsoft SQL Server?:
None of this is magic. Just click around inside the Tableau Server web application while applying filters you think are useful. Then, check out the resulting query string Tableau generates for you. Copy, paste, repeat.
In the final post (once my fingers stop cramping up), we’ll talk about different strategies you might use to parse all these files…