About transforming commands and searches
To create charts visualizations, your search must transform event data into statistical data tables. These statistical tables are required for charts and other kinds of data visualizations. This section discusses how to use transforming commands to transform event data.
This section describes the major categories of transforming commands and provides examples of how they can be used in a search.
Transforming commands
The primary transforming commands are:
chart
: creates charts that can display any series of data that you want to plot. You can decide what field is tracked on the x-axis of the chart.timechart
: used to create "trend over time" reports, which means that_time
is always the x-axis.top
: generates charts that display the most common values of a field.rare
: creates charts that display the least common values of a field.stats
: generates a report that display summary statistics.
See Transforming commands in the Search Reference to learn more.
Note: As you will see in the following examples, you always place your transforming commands after your search commands, linking them with a pipe operator ( | ).
The chart
, timechart
, and stats
commands are all designed to work with statistical functions. The list of available statistical functions includes:
- count, distinct count
- mean, median, mode
- min, max, range, percentiles
- standard deviation, variance
- sum
- first occurrence, last occurrence
For more information about statistical functions, see Statistical and charting functions in the Search Reference. Some statistical functions only work with the timechart
command.
Note: All searches with transforming commands generate specific data structures. The different chart types require these data structures to be set up in particular ways. For example, not all searches that enable you to generate bar, column, line, and area charts can be used to generate pie charts. See Data structure requirements for visualizations in the Dashboard and Visualizations manual to learn more.
Table, chart, and report examples
The following examples use transforming commands to create tables, charts, and reports:
- Create time based charts
- Create charts that are not (necessarily) time-based
- Create reports that display summary statistics
- Build a chart of multiple data series
Real-time reporting
You can use real-time search to calculate metrics in real time on large incoming data flows without the use of summary indexing. However, because you are reporting on a live and continuous stream of data, the timeline will update as the events stream in and you can only view the table or chart in preview mode. Also, some search commands will be more applicable (for example, streamstats and rtorder) for use in real-time. See About real-time searches and reports.
See also
Change the format of subsearch results | Create time-based charts |
This documentation applies to the following versions of Splunk Cloud Platform™: 8.2.2112, 8.2.2201, 8.2.2202, 8.2.2203, 9.0.2205, 9.0.2208, 9.0.2209, 9.0.2303, 9.0.2305, 9.1.2308, 9.1.2312, 9.2.2403, 9.2.2406 (latest FedRAMP release), 9.3.2408
Feedback submitted, thanks!