HTTP

다운로드 18
업데이트 2026. 2. 20.

사용 매뉴얼

HTTP 앱은 접속 프로파일 기반의 REST API 쿼리 명령어를 제공합니다. 다양한 인증 방식(Bearer, Basic, None), PATCH를 포함한 모든 HTTP 메서드, 대용량 응답을 위한 멀티라인 스트리밍 출력을 지원합니다.

명령어 목록

드라이버 명령어배치 명령어메서드본문
http-gethttp-get-batchGETX
http-posthttp-post-batchPOSTO
http-puthttp-put-batchPUTO
http-patchhttp-patch-batchPATCHO
http-deletehttp-delete-batchDELETEO
http-head-HEADX
http-options-OPTIONSX
  • 드라이버 명령어: 쿼리 파이프라인의 시작점입니다. URL 또는 path를 직접 지정하여 단일 요청을 수행합니다.
  • 배치 명령어: 파이프라인 중간에 사용합니다. 입력 행마다 url 또는 path 필드를 읽어 요청을 수행합니다.

드라이버 명령어 사용법

http-get [profile=프로파일] [url=URL] [path=경로] [timeout=초] [encoding=인코딩] [resp-header-field=필드명] [brex=정규식] [erex=정규식]
  • profile: 접속 프로파일 이름
  • url: 전체 요청 URL (프로파일 미지정 시 필수)
  • path: 엔드포인트 기준 상대 경로 (프로파일 사용 시)
  • timeout: HTTP 타임아웃 초 (기본값: 30)
  • encoding: 문자 인코딩 (기본값: utf-8)
  • resp-header-field: 응답 헤더를 저장할 출력 필드명 (미지정 시 생략)
  • brex: 멀티라인 엔트리의 시작 줄을 판정하는 정규표현식. GET, POST, PUT, PATCH, DELETE에서 사용 가능.
  • erex: 멀티라인 엔트리의 마지막 줄을 판정하는 정규표현식. GET, POST, PUT, PATCH, DELETE에서 사용 가능.

POST, PUT, PATCH, DELETE의 경우 추가 옵션:

  • format: 요청 본문 형식: json, form, xml, plain (기본값: json)
  • body: 요청 본문 문자열

배치 명령어 사용법

... | http-get-batch [profile=프로파일] [header=필드명] [timeout=초] [encoding=인코딩] [resp-header-field=필드명]
  • profile: 접속 프로파일 이름. 미지정 시 입력 행에 url 필드 필수.
  • header: 추가 헤더 맵이 담긴 필드명
  • timeout: HTTP 타임아웃 초 (기본값: 30)
  • encoding: 문자 인코딩 (기본값: utf-8)
  • resp-header-field: 응답 헤더를 저장할 출력 필드명 (미지정 시 생략)

POST, PUT, PATCH, DELETE 배치 명령어의 경우 추가 옵션:

  • format: 요청 본문 형식: json, form, xml, plain (기본값: json)
  • body: 요청 본문이 담긴 필드명. 생략 시 입력 행의 필드(url, path, header 필드 제외)를 지정된 format에 따라 자동 조립합니다.

배치 URL 결정 방식

  • profile 지정 시: 입력 행의 path 필드를 읽어 프로파일의 endpoint에 연결
  • profile 미지정 시: 입력 행의 url 필드를 전체 URL로 사용

멀티라인 스트리밍 (brex/erex)

드라이버 명령어에 brex (시작 정규식) 또는 erex (끝 정규식)를 지정하면 대용량 응답을 메모리에 전체 로딩하지 않고 멀티라인 엔트리 단위로 스트리밍 출력합니다. NDJSON, CSV, 로그 응답에 유용합니다.

http-get profile=myapi path=/logs/export brex="^\\d{4}-\\d{2}-\\d{2}"
| fields line

사용 예시

프로파일 없이 공개 API 호출

http-get url=https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
| parsejson

쿼리 파라미터로 GET 조회

주소 그룹 목록 조회 | 로그프레소 소나 REST API 레퍼런스

http-get profile=myapi path="/api/sonar/address-groups?limit=5"
| parsejson

form 본문으로 POST 생성

주소 그룹 생성 | 로그프레소 소나 REST API 레퍼런스

http-post profile=myapi path=/api/sonar/address-groups format=form body="name=TestGroup&description=My+group"
| parsejson

PUT 수정

주소 그룹 수정 | 로그프레소 소나 REST API 레퍼런스

http-put profile=myapi path=/api/sonar/address-groups/{guid} format=form body="name=UpdatedName&description=Updated"
| parsejson

쿼리 파라미터로 DELETE

주소 그룹 일괄 삭제 | 로그프레소 소나 REST API 레퍼런스

http-delete profile=myapi path="/api/sonar/address-groups?guids={guid}"
| parsejson

배치 POST - 대량 생성 (본문 자동 조립)

주소 객체 생성 | 로그프레소 소나 REST API 레퍼런스

body 옵션을 생략하면 입력 행의 필드로 요청 본문이 자동 조립됩니다.

json "{}" | repeat count=10
| eval address = format("10.0.0.%d", seq())
| eval description = "batch"
| eval path = "/api/sonar/address-groups/{guid}/addresses"
| http-post-batch profile=myapi format=form
| parsejson

배치 POST - 명시적 본문 지정

body 필드를 직접 지정할 수도 있습니다.

json "{}" | repeat count=10
| eval ip = format("10.0.0.%d", seq())
| eval body_data = concat("{\"address\":\"", ip, "\",\"description\":\"batch\"}")
| eval path = "/api/sonar/address-groups/{guid}/addresses"
| http-post-batch profile=myapi body=body_data
| parsejson

배치 DELETE - 대량 삭제

주소 객체 일괄 삭제 | 로그프레소 소나 REST API 레퍼런스

json "{}" | repeat count=10
| eval ip = format("10.0.0.%d", seq())
| eval path = concat("/api/sonar/address-groups/{guid}/addresses?addresses=", ip)
| http-delete-batch profile=myapi
| parsejson

대용량 NDJSON 스트리밍

http-post profile=elastic path=/_search?scroll=1m erex="\n"
| parsejson