

Following is the definition for this macro: The macro references the original makesessions macro. To build the same report with varying span lengths, save the report as a search macro with an argument for the span length. Sourcetype=access_* | `makesessions` | timechart span=1d sum(eventcount) as pageviews count as sessions The following search uses the makesessions search macro to return a report of the number of pageviews per session for each day: The following search uses the makesessions search macro to take web traffic events and break them into sessions: Following is the definition of makesessions: The following example demonstrates how you can use search macros to build reports based on a defined transaction.Ī search macro named makesessions defines a transaction session from events that share the same clientip value, and that occur within 30 minutes of each other. You can combine transactions and macro searches to simplify your transaction searches and reports.

We can use the Event type along with other queries. To view the event we just created above, we can write the below search query in the search box and we can see the resulting events along with the colour we have chosen for the event type. On clicking the button New Event Type we get the following screen to add the same query as in the previous section. The other option to create a new Event Type is to use the Settings → Event Types option as shown below where we can add a new Event Type − The priority option decides which event type will be displayed first in case two or more event types match the same event.įinally, we can see the Event Type has been created by going to the Settings → Event Types option. The next screen prompts to give a name for the Event Type, choose a Tag which is optional and then choose a colour with which the events will be highlighted. After running the search query, we can choose Save As option to save the query as an Event Type. Using a SearchĬonsider the search for the events which have the criteria of successful http status value of 200 and the event type run on a Wednesday. We will see both the ways of creating it in this section. Another is to add a new Event Type from the settings tab. One is to run a search and then save it as an Event Type. There are two ways to create an event type after we have decided the search criteria. Every event that can be returned by the search gets an association with that event type. In short, an event type represents a search that returns a specific type of event or a useful collection of events. This event now can be saved as an event type with a user defined name as status200 and use this event name as part of future searches.
#Splunk sideview showhide example code
For example, we search for only the events which have a http status code of 200. In Splunk search, we can design our own events from a dataset based on certain criteria.
