Using Field in Searching(使用字段搜索)

Task 1: Use the Fields sidebar to examine search results.
In the app navigation bar (i.e., the bar towards the top of the browser window,) click Search. If you do not see Search in the application bar – or to clear the previous search - click the App: Search & Reporting in the Splunk bar at the top of the browser window.
Search for index=main sourcetype=access_combined_wcookie action=purchase for All time.
This returns all events where a purchase action was taken

任务1:使用字段侧栏检查搜索结果。
在app导航栏(即,该栏朝向浏览器窗口的顶部,)点击搜索。如果你没有在应用程序栏中看到搜索,或者没有清除之前的搜索,点击浏览器窗口顶部的Splunk栏中的App: Search & Reporting。
搜索索引=main sourcetype=access_combined_wcookie动作=购买所有时间。
这将返回执行购买操作的所有事件

NOTE: After the search finalizes, verify that the search executed in Smart Mode. The search mode
displays under the time range picker. If the search did not execute in Smart Mode, change it to
Smart Mode, and then re-execute the search.

注意:在搜索完成之后,验证搜索是在智能模式下执行的。搜索模式显示在时间范围选择器下。如果搜索没有在智能模式下执行,将其更改为智能模式,然后重新执行搜索。

Examine the Fields sidebar’s Interesting Fields list. Notice that productId is one of the fields extracted
by Splunk.
In the Fields sidebar, under Interesting Fields, click productId. Notice the pop-up window shows the top
ten purchased products by productId. Close the window by clicking the x in the upper right corner.

检查字段侧栏中有趣的字段列表。注意,productId是Splunk提取的字段之一。
在字段侧栏有趣的字段下,单击productId。注意,弹出窗口显示了productId购买的前十种产品。单击右上角的x关闭窗口。

Results Example

In the Fields sidebar, under Interesting Fields, click status. This field contains the status of the web request. Anything greater than 200 means that the customer interaction ended in an error, and the purchase was not made.

在字段侧栏有趣的字段下,单击status。此字段包含web请求的状态。大于200表示客户交互以错误结束,并且没有进行购买。

Results Example

To quickly view the status for each event, you can make it selected. From the status field window, click Yes in the upper right corner next to Selected. Close the window by clicking the x in the upper right corner.
Notice status is now a selected field in the Fields sidebar and status=value is displayed below each event.

要快速查看每个事件的状态,可以选择它。在“状态字段”窗口中,单击“是”,位于选择项旁边的右上角。单击右上角的x关闭窗口。
通知状态现在是字段侧栏中选择的字段,状态=值显示在每个事件下面。

Results Example

在Fields侧栏中,在选中的字段下,单击status字段。在字段窗口中,单击数字最高的值(在顶部列出)。注意,字段和值已经添加到搜索栏中的搜索条件中。此外,这个选择将导致使用新的搜索条件执行新的搜索。

因为在大多数结果中显示的值是200,所以您不会看到服务器错误。更改比较运算符将纠正这一点。


将状态搜索更改为:status!=200并重新执行搜索。
注意,现在您的搜索只返回以错误结束的web购买。
有多少事件以错误告终?您可以在搜索栏下看到事件计数。记住这个数字,因为你可能会在测验中被问到。
(1301)


在字段侧栏中,再次单击status并在选中的旁边的右上角选择No。这将从选中的字段列表中删除它。单击右上角的x关闭字段窗口。单击Splunk栏中的搜索链接以清除搜索结果。

任务2:使用搜索历史来浏览以前运行的搜索。
单击“搜索历史”查看过去的搜索历史。与jobs不同,jobs将搜索结果保存很短的时间,在这里您只看到您的搜索条件,这些条件保存了很长时间。你经常会有很多搜索。您可以根据时间或内容筛选搜索结果。
单击搜索历史过滤框内,并输入purchase。注意,搜索列表缩短了。只有包含“购买”一词的搜索仍然存在。

对于其中一个搜索,单击Add to Search。注意,搜索条件出现在搜索栏中,但是时间范围仍然显示默认设置。
更改时间范围,可选择添加或更改搜索条件,然后执行搜索。

任务3:使用Jobs页面查看最近的搜索。

在Splunk条(它是指向浏览器窗口顶部的黑色条)中,单击Activity > Jobs。

查看搜索字符串,看看是否有任何击键错误。您可能会看到类似“|元数据…”或“|历史……”,当您访问了扩展您的搜索历史记录时,将会出现。

猜你喜欢

转载自blog.csdn.net/liangkaiping0525/article/details/81779171
今日推荐