Skip to content

Commit

Permalink
doc: add doc for write log data using grpc protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
paomian committed Sep 26, 2024
1 parent 12b58b7 commit 137bfe0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/user-guide/ingest-data/for-iot/grpc-sdks/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

This guide will demonstrate how to use client libraries to write and query data in GreptimeDB.
This guide will demonstrate how to use client libraries to write data in GreptimeDB.

- [Go](go.md)
- [Java](java.md)
8 changes: 8 additions & 0 deletions docs/user-guide/logs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ CREATE TABLE `origin_logs` (

### Insert logs

#### Write logs using the SQL protocol

Use the `INSERT` statement to insert logs into the table.

```sql
Expand All @@ -39,6 +41,12 @@ INSERT INTO origin_logs (message, time) VALUES
The above SQL inserts the entire log text into a single column,
and you must add an extra timestamp for each log.

#### Write logs using the gRPC protocol

You can also write logs using the gRPC protocol, which is a more efficient method.

Refer to [Write Data Using gRPC](../ingest-data/for-iot/grpc-sdks/overview.md) to learn how to write logs using the gRPC protocol.

## Write logs by Pipeline

Using a pipeline allows you to automatically parse and transform the log message into multiple columns,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 概述

本指南将演示如何使用 SDK 在 GreptimeDB 中写入和查询数据
本指南将演示如何使用 SDK 在 GreptimeDB 中写入数据

- [Go](go.md)
- [Java](java.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ CREATE TABLE `origin_logs` (

### 插入日志

#### 使用 SQL 协议写入

使用 `INSERT` 语句将日志插入表中。

```sql
Expand All @@ -38,6 +40,12 @@ INSERT INTO origin_logs (message, time) VALUES

上述 SQL 将整个日志文本插入到一个列中,除此之外,您必须为每条日志添加一个额外的时间戳。

#### 使用 gRPC 协议写入

您也可以使用 gRPC 协议写入日志,这是一个更高效的方法。

请参阅[使用 gRPC 写入数据](../ingest-data/for-iot/grpc-sdks/overview.md)以了解如何使用 gRPC 协议写入日志。

## 使用 Pipeline 写入日志

使用 pipeline 可以自动将日志消息格式化并转换为多个列,并自动创建表。
Expand Down

0 comments on commit 137bfe0

Please sign in to comment.