컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
strings.concat
strings.concat(a, b, c, ...)
설명
무제한 항목 연결을 반환합니다. 각 항목은 문자열, 정수 또는 부동 소수점 수일 수 있습니다.
인수가 이벤트 필드인 경우 속성은 동일한 이벤트에서 생성되어야 합니다.
매개변수 데이터 유형
STRING
, FLOAT
, INT
반환 유형
STRING
코드 샘플
예 1
다음 예시에는 문자열 변수와 정수 변수가 인수로 포함됩니다. principal.hostname
및 principal.port
모두 같은 이벤트인 $e
에서 생성 및 연결되어 문자열을 반환합니다.
"google:80" = strings.concat($e.principal.hostname, ":", $e.principal.port)
예 2
다음 예시에는 문자열 변수와 문자열 리터럴이 인수로 포함됩니다.
"google-test" = strings.concat($e.principal.hostname, "-test") // Matches the event when $e.principal.hostname = "google"
예 3
다음 예시에는 문자열 변수와 부동 소수점 리터럴이 인수로 포함됩니다.
문자열로 표현될 경우 정수인 부동 소수점 수는 소수점 없이 형식으로 지정됩니다(예: 1.0은 '1'로 표시). 또한 16자리를 초과하는 부동 소수점 수는 소수점 이하 16번째 자리에서 잘립니다.
"google2.5" = strings.concat($e.principal.hostname, 2.5)
예 4
다음 예시에는 문자열 변수, 문자열 리터럴, 정수 변수, 부동 리터럴이 인수로 포함됩니다. 모든 변수는 같은 이벤트인 $e
에서 생성되고 리터럴과 연결되어 문자열을 반환합니다.
"google-test802.5" = strings.concat($e.principal.hostname, "-test", $e.principal.port, 2.5)
예시 5
다음 예시에서는 이벤트 $e1
의 principal.port를 이벤트 $e2
의 principal.hostname
과 연결하려고 시도합니다. 인수가 서로 다른 이벤트 변수이므로 컴파일러 오류가 반환됩니다.
// Will not compile
"test" = strings.concat($e1.principal.port, $e2.principal.hostname)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-29(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-29(UTC)"],[[["\u003cp\u003e\u003ccode\u003estrings.concat\u003c/code\u003e combines multiple strings, integers, or floats into a single string, supporting an unlimited number of arguments.\u003c/p\u003e\n"],["\u003cp\u003eWhen using event fields as arguments within \u003ccode\u003estrings.concat\u003c/code\u003e, all fields must be attributes originating from the same event.\u003c/p\u003e\n"],["\u003cp\u003eThe function supports various data types, including \u003ccode\u003eSTRING\u003c/code\u003e, \u003ccode\u003eFLOAT\u003c/code\u003e, and \u003ccode\u003eINT\u003c/code\u003e, and returns a \u003ccode\u003eSTRING\u003c/code\u003e value after concatenation.\u003c/p\u003e\n"],["\u003cp\u003eFloat numbers in \u003ccode\u003estrings.concat\u003c/code\u003e are formatted as whole numbers without a decimal point when they are whole numbers, and they are truncated to the sixteenth decimal place if exceeding that value.\u003c/p\u003e\n"],["\u003cp\u003eAttempting to concatenate event fields that belong to different events will result in a compiler error.\u003c/p\u003e\n"]]],[],null,["### strings.concat\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.concat(a, b, c, ...)\n\n#### Description\n\nReturns the concatenation of an unlimited number of items, each of which can be\na string, integer, or float.\n\nIf any arguments are event fields, the attributes must be from the same event.\n\n#### Param data types\n\n`STRING`, `FLOAT`, `INT`\n\n#### Return type\n\n`STRING`\n\n#### Code samples\n\n##### Example 1\n\nThe following example includes a string variable and integer variable as\narguments. Both `principal.hostname` and `principal.port` are from the same\nevent, `$e`, and are concatenated to return a string. \n\n \"google:80\" = strings.concat($e.principal.hostname, \":\", $e.principal.port)\n\n##### Example 2\n\nThe following example includes a string variable and string literal as arguments. \n\n \"google-test\" = strings.concat($e.principal.hostname, \"-test\") // Matches the event when $e.principal.hostname = \"google\"\n\n##### Example 3\n\nThe following example includes a string variable and float literal as arguments.\nWhen represented as strings, floats that are whole numbers are formatted without\nthe decimal point (for example, 1.0 is represented as \"1\"). Additionally,\nfloats that exceed sixteen decimal digits are truncated to the sixteenth decimal\nplace. \n\n \"google2.5\" = strings.concat($e.principal.hostname, 2.5)\n\n##### Example 4\n\nThe following example includes a string variable, string literal,\ninteger variable, and float literal as arguments. All variables are from the\nsame event, `$e`, and are concatenated with the literals to return a string. \n\n \"google-test802.5\" = strings.concat($e.principal.hostname, \"-test\", $e.principal.port, 2.5)\n\n##### Example 5\n\nThe following example attempts to concatenate principal.port from event `$e1`,\nwith `principal.hostname` from event `$e2`. It will return a compiler error\nbecause the arguments are different event variables. \n\n // Will not compile\n \"test\" = strings.concat($e1.principal.port, $e2.principal.hostname)"]]