- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Construct | Syntax and Notation |
---|---|
Reserved attribute or tag named tag | tag (no prefix required) |
Attribute named attr | @attr (use an @ prefix) |
Calculated field named field | #field (use a # prefix) |
String literal (quote) For example, text or Quoted "text" . | "text" "Quoted \"text\"" (Log Search Syntax applies) |
Numeric literal (number) For example, ten . | 10 |
Function named func with parameters x and y | func(x, y) |
Operator For example, a binary operator * with operands x and y . | x*y |
The available operators in order of precedence:
Operator | Description |
---|---|
() | A grouping or function call |
! , NOT , - | A logical or arithmetic negation |
^ , % | Exponentiation, Modulo |
* , / | Multiplication, division |
+ , - | Addition, subtraction |
< , <= , > , >= | Less than, less than or equal to, greater than, greater than or equal to |
== , != | Match, does not match |
&& , AND | Logical AND |
|| , OR | Logical OR |
The available functions are categorized as follows:
Returns the absolute value of a number.
Example | Formula | Result |
---|---|---|
A log event has the following attributes: - @client_latency = 2- @server_latency = 3 | #discrepancy = abs(@client_latency - @server_latency ) | #discrepancy = 1 |
Rounds number up to the nearest integer.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@value = 2.2 | #rounded_up = ceil(@value ) | #rounded_up = 3 |
Rounds number down to the nearest integer.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@value = 9.99 | #rounded_down = floor(@value ) | #rounded_down = 9 |
Finds maximum value amongst a set of numbers.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@CPU_temperatures = [-1, 1, 5, 5] | #highest_temp = max(@CPU_temperatures ) | #highest_temp = 5 |
Finds the minimum value amongst a set of numbers.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@CPU_temperatures = [-1, 1, 5, 5] | #lowest_temp = min(@CPU_temperatures ) | #lowest_temp = -1 |
Rounds a number. Optionally, define how many decimal places to maintain.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@value = -1234.01 | #rounded_to_tens = round(@value , -1) | #rounded_to_tens = -1230 |
Combines multiple values into a single string.
Example | Formula | Result |
---|---|---|
A log event has the following attributes: - @city = “Paris”- @country = “France” | #concatenated_region = concat(@city , “, " @country ) | #concatenated_region = “Paris, France” |
Converts string to lowercase.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@first_name = “Bob” | #lower_name = lower(@first_name ) | #lower_name = “bob” |
Extracts a portion of text from the beginning of a string.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@price = “USD10.50” | #currency = left(@price , 3) | #currency = “USD” |
Converts string to proper case.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@address = “123 main st” | #formatted_address = proper(@address ) | #formatted_address = “123 Main St” |
Extracts the portion of text preceding a certain pattern in a string.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@url = "www.example.com/path/to/split" | #url_extraction = split_before(@url , "/", 1) | #url_extraction = "www.example.com/path" |
#url_extraction = split_before(@url , "/", 2) | #url_extraction = "www.example.com/path/to" |
Extracts the portion of text following a certain pattern in a string.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@url = "www.example.com/path/to/split" | #url_extraction = split_after(@url , "/", 1) | #url_extraction = "path/to/split" |
#url_extraction = split_after(@url , "/", 2) | #url_extraction = "to/split" |
Extracts a portion of text from the middle of a string.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@price = “USD10.50” | #dollar_value = substring(@price , 2, 2) | #dollar_value = “10” |
Extracts a portion of text from the end of a string.
Example | Formula | Result |
---|---|---|
A log event has the following attribute:@price = “USD10.50” | #cent_value = right(@price , 2) | #cent_value = “50” |
Combines multiple values into a single string with a delimiter in between.
Example | Formula | Result |
---|---|---|
A log event has the following attributes: - @city = “Paris”- @country = “France” | #join_region = textjoin(”, “, “false”, @city , @country ) | #join_region = “Paris, France” |
Converts string to uppercase.
Example | Formula | Result |
---|---|---|
A log event has the following attribute: @first_name = “Bob” | #upper_name = upper(@first_name ) | #upper_name = “BOB” |
Evaluates a condition and returns a value accordingly.
Example | Formula | Result |
---|---|---|
A log event has the following attributes: - @location = “Paris, France”- @home = “New York, USA” | #abroad = if(@location == @home , “false”, “true”) | #abroad = “true” |
Checks if an attribute or expression is null.
Example | Formula | Result |
---|---|---|
A log event has the following attributes: - @users_online = 5- @max_capacity = 0 | is_null(@users_online / @max_capacity ) | “true” |
추가 유용한 문서, 링크 및 기사: