- Implementing Splunk(Second Edition)
- Vincent Bumgarner James D. Miller
- 303字
- 2021-07-16 13:34:57
About the pipe symbol
Before we pe into the actual commands, it is important to understand what the pipe symbol (|) is used for in Splunk. In a command line, the pipe symbol is used to represent the sending of data from one process to another. For example, in a Unix-style operating system, you might say:
grep foo access.log | grep bar
The first command finds, in the file access.log
, lines that contain foo
. Its output is taken and piped to the input of the next grep
command, which finds lines that contain bar. The final output goes wherever it was destined, usually to the terminal window.
The pipe symbol is different in Splunk in a few important ways:
- Unlike the command line, events are not simply text, but rather each is a set of key/value pairs. You can think of each event as a database row, a Python dictionary, a JavaScript object, a Java map, or a Perl associative array. Some fields are hidden from the user but are available for use. Many of these hidden fields are prefixed with an underscore; for instance
_raw
, which contains the original event text, and_time
, which contains the parsed time in UTC epoch form. Unlike a database, events do not adhere to a schema, and fields are created dynamically. - Commands can do anything to the events that they are handed. Usually, a command does one of the following:
- Modifies or creates fields—for example,
eval
,rex
- Filters events—for example,
head
,where
- Replaces events with a report—for example,
top
,stats
- Sorts the results of a search—using
sort
- Modifies or creates fields—for example,
- Some commands can act as generators, which produce what you might call synthetic events, such as
|metadata
and|inputcsv
.
We will get to know the pipe symbol very well through examples.
推薦閱讀
- 黑客攻防從入門到精通(實戰(zhàn)秘笈版)
- 新編Visual Basic程序設(shè)計上機實驗教程
- Apache Spark 2.x Machine Learning Cookbook
- Mastering Natural Language Processing with Python
- HTML5游戲開發(fā)案例教程
- C++程序設(shè)計基礎(chǔ)教程
- 持續(xù)集成與持續(xù)交付實戰(zhàn):用Jenkins、Travis CI和CircleCI構(gòu)建和發(fā)布大規(guī)模高質(zhì)量軟件
- Spring技術(shù)內(nèi)幕:深入解析Spring架構(gòu)與設(shè)計原理(第2版)
- Machine Learning With Go
- OpenMP核心技術(shù)指南
- ActionScript 3.0從入門到精通(視頻實戰(zhàn)版)
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Data Science Algorithms in a Week
- Oracle 12c從入門到精通(視頻教學(xué)超值版)
- Software Development on the SAP HANA Platform