Go to main content

man pages section 5: File Formats

Exit Print View

Updated: Thursday, June 13, 2019
 
 

sstore.csv (5)

Name

sstore.csv - sstore CSV export format

Description

The Oracle Solaris Statistics Store allows export of data in Comma-Separated Values (CSV) format, through both the sstore export command and the sstore_iter_export() function in the libsstore file. For more information, see the sstore(1), sstore_iter_export(3SSTORE) and libsstore(3LIB) man pages.

The sstore command exports CSV-formatted values as a single line per timestamp which can be imported into a spreadsheet application.

When requesting CSV output, the statistics store should always be queried with a time range and a granularity or step in seconds.

On the command line, step size can be set by using the –i option.

For the sstore_iter_export() function, use the sstore_range_set_times parameter to provide the range and granularity. For more information, see the sstore_iter_export(3SSTORE) man page.

Format

The generic form of the output is as follows and is described in more detail below.

"time",<ssid1>,<ssid2>,<ssid3>, ...
<time>,<value1>,<value2>,<value3>, ...
<time>, <value1>,<value2>,<value3>, ...
...
...
<time>,<value1>,<value2>,<value3>, ...

The output is ordered from <start-time> to <end-time> time range with <step> second interval as requested.

Fields

The first row in the CSV output is the header line. The first column in the CSV output is the time line, which has the requested time range with step intervals. The remaining (row, column) fields are the data points that correspond to (timestamp, ssid) values.

time (String)

This word is reserved and indicates that the first column contains time values in seconds since epoch

start-time (String)

The time stamp of a data point or start of the time range for data points

end-time (String)

The end of the time range for data points

ssid (String)

The SSID of the statistic or event for which the data was requested. The SSIDs are formatted differently based on the data value types returned from the statistics store

value (String)

The value of the SSID data point at (time). This field is empty if the statistics sstore returns the NO_DATA value type. The SSTORE_VALUE_STRING and SSTORE_VALUE_STRING_ARRAY value types are delimited by double quotation marks because these values may have one or more fields separated by commas

Data value types

SSTORE_VALUE_NUMBER, SSTORE_VALUE_REAL or SSTORE_VALUE_STRING A single column is inserted with ssid as header. For more information, see Example 1.

SSTORE_VALUE_STRING_ARRAY or SSTORE_VALUE NUMBER_ARRAY

The SSID field becomes ssid[array_index]. One column is inserted for each element in the array. Each column has ssid[array_index] as the header. For more information, see Example 3.

SSTORE_VALUE_DICTIONARY

The SSID field becomes ssid(key). One column is inserted for each key in the dictionary. Each column has ssid(key as the header. For more information, see Example 2.

If sstore returns nested DICTIONARY value types, then the SSID is formatted as ssid[nested_key](key). In this case, the number of columns is (nested_keys * keys). For more information, see Example 4.

Examples

Example 1 Export Statistics of Type SSTORE_VALUE_NUMBER With NO_DATA in Some Records

The following example exports statistics of type SSTORE_VALUE_NUMBER with NO_DATA in some records.

# sstore export -F CSV -t 2015-09-24T11:03:02 -e 2015-09-24T11:03:07\ 
 -i 1 //:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel

time,//:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel
1443117782000000,
1443117783000000,2820982996873.959473
1443117784000000,2820985895214.774902
1443117785000000,2820988854036.566406
1443117786000000,2820992197694.168945
1443117787000000,2820995531138.603027
Example 2 Export Statistics of Type SSTORE_VALUE_DICTIONARY

The following example exports statistics of type SSTORE_VALUE_DICTIONARY.

# sstore export -F CSV -t 2015-09-24T13:09:18 -e 2015-09-24T13:09:22 \ 
-i 1 //:class.cpu//:res.id/0//:stat.usage//:part.mode

time,//:class.cpu//:res.id/0//:stat.usage//:part.mode(user),//:class.cpu//:res.id/0//:stat.usage//:part.mode(stolen),
//:class.cpu//:res.id/0//:stat.usage//:part.mode(kernel),//:class.cpu//:res.id/0//:stat.usage//:part.mode(intr)\,
//:class.cpu//:res.id/0//:stat.usage//:part.mode(idle)
1443125358000000,1106975.936433,0.000000,2917194.872246,246953.368492,158420692.139363
1443125359000000,1106976.745205,0.000000,2917205.923870,246954.860221,158421680.299638
1443125360000000,1106996.450732,0.000000,2917270.827686,246956.654816,158422595.494543
1443125361000000,1106996.544354,0.000000,2917274.466301,246958.344146,158423591.907700
1443125362000000,1106996.563427,0.000000,2917276.952832,246959.961009,158424589.549877
Example 3 Export Metadata for Two Different SSIDs

The following example exports metadata for two different SSIDs.

sstore info -F CSV //:class.cpu//:res.id/0//:stat.usage//:part.mode \ 
//:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel

time,//:class.cpu//:res.id/0//:stat.usage//:part.mode($schema),//:class.cpu//:res.id/0//:stat.usage//:part.mode(copyright),//:class.cpu//:res.id/0//:stat.usage//:part.mode(stability),
//:class.cpu//:res.id/0//:stat.usage//:part.mode(description),//:class.cpu//:res.id/0//:stat.usage//:part.mode(id),//:class.cpu//:res.id/0//:stat.usage//:part.mode(localize)[0],
//:class.cpu//:res.id/0//:stat.usage//:part.mode(multiplier),//:class.cpu//:res.id/0//:stat.usage//:part.mode(type),//:class.cpu//:res.id/0//:stat.usage//:part.mode(units),
//:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel(stability),//:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel(type),//:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel(description),
//:class.kstat//:res.misc/cpu/sys/0//:stat.cpu_nsec_kernel(units)
1443125991577576,"//:stat","Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.","stable","system time per cpu","//:class.cpu//:stat.usage","description",1000000,"counter",
"milliseconds","unstable","accum-boot","total kernel time",1000000000
Example 4 Export Statistics for Events

The following example exports statistics for events.

sstore export -F CSV -t 2015-09-24T13:49:25 -e 2015-09-24T13:49:26 -i 1\ 
//:class.event//:event.adm-action//:fmt.raw

time,//:class.event//:event.adm-action//:fmt.raw[0](version),//:class.event//:event.adm-action//:fmt.raw[0](event),//:class.event//:event.adm-action//:fmt.raw[0](modifier),
	//:class.event//:event.adm-action//:fmt.raw[0](host),//:class.event//:event.adm-action//:fmt.raw[0](iso8601),//:class.event//:event.adm-action//:fmt.raw[0](argument(0)/arg-num),
	//:class.event//:event.adm-action//:fmt.raw[0](argument(0)/value),//:class.event//:event.adm-action//:fmt.raw[0](argument(0)/desc),//:class.event//:event.adm-action//:fmt.raw[0](argument(1)/arg-num),
	//:class.event//:event.adm-action//:fmt.raw[0](argument(1)/value),//:class.event//:event.adm-action//:fmt.raw[0](argument(1)/desc),//:class.event//:event.adm-action//:fmt.raw[0](text/value),
	//:class.event//:event.adm-action//:fmt.raw[0](subject/audit-uid),//:class.event//:event.adm-action//:fmt.raw[0](subject/uid),//:class.event//:event.adm-action//:fmt.raw[0](subject/gid),
	//:class.event//:event.adm-action//:fmt.raw[0](subject/ruid),//:class.event//:event.adm-action//:fmt.raw[0](subject/rgid),//:class.event//:event.adm-action//:fmt.raw[0](subject/pid),
	//:class.event//:event.adm-action//:fmt.raw[0](subject/sid),//:class.event//:event.adm-action//:fmt.raw[0](subject/tid),//:class.event//:event.adm-action//:fmt.raw[0](use_of_privilege/result),
	//:class.event//:event.adm-action//:fmt.raw[0](use_of_privilege/value),//:class.event//:event.adm-action//:fmt.raw[0](return/errval),//:class.event//:event.adm-action//:fmt.raw[0](return/retval),
	//:class.event//:event.adm-action//:fmt.raw[1](version),//:class.event//:event.adm-action//:fmt.raw[1](event),//:class.event//:event.adm-action//:fmt.raw[1](host),
	//:class.event//:event.adm-action//:fmt.raw[1](iso8601),//:class.event//:event.adm-action//:fmt.raw[1](subject/audit-uid),//:class.event//:event.adm-action//:fmt.raw[1](subject/uid),
	//:class.event//:event.adm-action//:fmt.raw[1](subject/gid),//:class.event//:event.adm-action//:fmt.raw[1](subject/ruid),//:class.event//:event.adm-action//:fmt.raw[1](subject/rgid),
	//:class.event//:event.adm-action//:fmt.raw[1](subject/pid),//:class.event//:event.adm-action//:fmt.raw[1](subject/sid),//:class.event//:event.adm-action//:fmt.raw[1](subject/tid),
	//:class.event//:event.adm-action//:fmt.raw[1](return/errval),//:class.event//:event.adm-action//:fmt.raw[1](return/retval)
	1443127765000000,"2","AUE_P_ONLINE","sp","xx-xxxxx-x","2015-09-24 13:49:19.775-07:00","1","0x1","processor ID","2","0x2","flag","P_ONLINE","xxyyzz","root","root","root","root","112973","2074443028",
	"65314 22 host","successful use of priv","sys_res_config","success","1","2","AUE_su_logout","ns-x4100-2",
	"2015-09-24 13:49:25.354-07:00","user","root","root","root","root","101491","2074443028","65314 22 host","success","0"
	1443127766000000,"2","AUE_su",,"xx-xxxxx-x","2015-09-24 13:49:38.886-07:00",,,,,,,,"xxyyzz","root","root","root","root","112976","2074443028",
	"65314 22 host",,,"success","0",,,,,,,,,,,,,,

See Also

libsstore(3LIB), strftime(3C), sstore_range_alloc(3SSTORE), attributes(7), sstore(7)