Professional Documents
Culture Documents
In this section, we are going to learn about the Basic Searches in the Splunk. We
will also learn about the matching string, matches searches, how to retrieve events
form the index, understanding search result, timeline of the event and pattern
visualization and statistics.
We build searches in this section that retrieve events from the index.
The data for this tutorial is taken from titaniac.csv file, which we have uploaded
earlier while the data ingestion. The file contains the information of the peoples
who were present on the titanic.
Matching Searches
The Search manager also returns matching searches, which are based on your recent
searches. The list of matching searches is useful if you want to run the same
search from yesterday or from a week ago. When you log out, your search history
will be retained.
After you start learning the search language, the search assistant becomes more
useful. The search wizard shows command information when you type search commands.
You type the keywords in your search field to retrieve events that list errors or
failures. If you're using several keywords, you need to define Boolean operators
like AND, OR, and NOT.
The AND logical operator is implied when you type in multiple keywords.
For example, typing class is the same as typing titanic AND class.
Words within parentheses are given priority when evaluating Boolean expressions.
NOT clauses shall be determined before the OR clauses. The lowest precedence is
given to clauses AND.
Fields sidebar
When adding data to the Splunk platform, it indexes the data. Information is
extracted from the data as part of the indexing process, and structured as name and
value pairs, called fields. When you run a search, next to your search results, the
fields will be marked and described in the sidebar Fields. Fields are broken down
into two groups.
Selected fields are visible in the event results. By default, host, source, and
source type appear. You can choose other fields to show in your events in your
results.
Interesting fields are the fields that have been extracted from the events.
You can hide the field's sidebar to maximize the results area.
When you run a quest, the Statistics tab populates with transforming commands such
as stats, top, map, etc.
The Visualization tab also fills in searches with transforming commands. The
Visualizations tab results region contains a diagram and the statistics table used
to create the diagram.
You'll learn how to convert commands, and use the tabs Statistics and
Visualizations, later in the tutorial.
Here we are given a search bar on the top where we can search anything we want from
our uploaded database.
We will write the index and the name, as shown in the image below, that we provided
in our index name while we uploaded the data in the Data Ingestion tutorial. We can
press the enter button from our keyboard, or we can also click on the search icon
that is present on the right end of the search bar.
Note
Make sure you set the time zone of the search to the All-Time as we have discussed
at the starting of this tutorial under the heading Setting the time zone for
effective searching.
It is a very important step to set the time of searching as the default feature of
Splunk is that provides timestamp to every data that comes in and goes out of the
Splunk.
Many times, it happens that we search our data in the wrong time zone due to which
we are not able to get the effective result from our Splunk platform. In this time
zone, we have several options with the help of which we can effectively set out the
time zone. We can set it in the Real-Time, Relative Time or All time.
We can also set the date in our time zone option between which we want our data to
be effectively searched.
As we click on the Search button after setting up the right time zone, we will get
the result. The result will consist of all the data that is associated with the
index named as titanic, as we can see on our screen.
Sometimes writing the string may not return the value, so we must take care that
for combining the different search perimeter, we must write the search string under
the double-quotes.
In the example below, we just want to search for the word Line in our dataset, so
we just wrote Line in our search bar. Then the events returned contain the string
that we searched for. For reference, you can have a look at the image below.