Skip to content

Commit d9de2b2

Browse files
rfmozRicardo F
andauthored
close #7924 - Update usage and behaviour of tags in http input (#1195)
* close #7924 - Update usage and behaviour of tags in http input Signed-off-by: Ricardo F <[email protected]> * close #7924 - Split lines to allow easier review Signed-off-by: Ricardo F <[email protected]> --------- Signed-off-by: Ricardo F <[email protected]> Co-authored-by: Ricardo F <[email protected]>
1 parent c3f7ac4 commit d9de2b2

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

pipeline/inputs/http.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,74 @@ The http input plugin allows Fluent Bit to open up an HTTP port that you can the
2828

2929
#### How to set tag
3030

31-
The tag for the HTTP input plugin is set by adding the tag to the end of the request URL. This tag is then used to route the event through the system. For example, in the following curl message below the tag set is `app.log`**. **If you do not set the tag `http.0` is automatically used. If you have multiple HTTP inputs then they will follow a pattern of `http.N` where N is an integer representing the input.
31+
The tag for the HTTP input plugin is set by adding the tag to the end of the request URL. This tag is then used to route the event through the system.
32+
For example, in the following curl message below the tag set is `app.log**. **` because the end end path is `/app_log`:
33+
34+
### Curl request
35+
36+
```
37+
curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log
38+
```
39+
40+
### Configuration File
41+
42+
```
43+
[INPUT]
44+
name http
45+
listen 0.0.0.0
46+
port 8888
47+
48+
[OUTPUT]
49+
name stdout
50+
match app.log
51+
```
52+
53+
If you do not set the tag `http.0` is automatically used. If you have multiple HTTP inputs then they will follow a pattern of `http.N` where N is an integer representing the input.
54+
55+
### Curl request
56+
57+
```
58+
curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888
59+
```
60+
61+
### Configuration File
62+
63+
```
64+
[INPUT]
65+
name http
66+
listen 0.0.0.0
67+
port 8888
68+
69+
[OUTPUT]
70+
name stdout
71+
match http.0
72+
```
73+
74+
75+
#### How to set tag_key
76+
77+
The tag_key configuration option allows to specify the key name that will be used to overwrite a tag. The tag's value will be replaced with the value associated with the specified key. For example, setting tag_key to "custom_tag" and the log event contains a json field with the key "custom_tag" Fluent Bit will use the value of that field as the new tag for routing the event through the system.
78+
79+
### Curl request
80+
81+
```
82+
curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log
83+
```
84+
85+
### Configuration File
86+
87+
```
88+
[INPUT]
89+
name http
90+
listen 0.0.0.0
91+
port 8888
92+
tag_key key1
93+
94+
[OUTPUT]
95+
name stdout
96+
match value1
97+
```
98+
3299

33100
#### How to set multiple custom HTTP header on success
34101

0 commit comments

Comments
 (0)