Compare commits
18 Commits
Author | SHA1 | Date |
---|---|---|
cn | c0a38af087 | |
cn | 5d647fd842 | |
Christian Nicolai | 9e977f7abb | |
Christian Nicolai | da21bc01cc | |
cn | 78ea23f555 | |
cn | 3360373cb6 | |
cn | 3c271eeed6 | |
cn | 459fea5baa | |
cn | cbdeef4bba | |
cn | 1d286163c9 | |
cn | 8396584552 | |
cn | ee37db2d42 | |
cn | f2d50423de | |
cn | 0b972b731f | |
cn | 0de289b882 | |
cn | 08ee38e700 | |
cn | 3e2a3f0cd0 | |
cn | 813fde30c0 |
34
CHANGELOG.md
34
CHANGELOG.md
|
@ -1,5 +1,39 @@
|
|||
# Changelog
|
||||
|
||||
## 1.1.3 (February 21, 2018)
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
- Add package keywords
|
||||
|
||||
## 1.1.2 (February 21, 2018)
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
- Detection of regex values (although not an official data type) to avoid weird highlighting
|
||||
|
||||
## 1.1.1 (November 25, 2017)
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
- Add installation instructions and screenshot
|
||||
|
||||
## 1.1.0 (November 25, 2017)
|
||||
|
||||
NEW FEATURES:
|
||||
|
||||
- Support folding markers for directives like `<source>...</source>`
|
||||
- Support toggling comments
|
||||
- Support escape sequenes like `foo\nbar` in single, double and unquoted strings
|
||||
- Support array and hash (using JSON source) value types like `["foo","bar"]`
|
||||
- Support integer, time and size value types (e.g. `property 100`, `bufsize 5M` or `finterval 5s`)
|
||||
- Support highlighting `${variables}` (used by e.g. [record_transformer plugin](https://docs.fluentd.org/v0.12/articles/filter_record_transformer))
|
||||
- Support (double quoted) string interpolations like `#{Time.new.to_i + 1}` (using Ruby source)
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
- Add example fluent.conf file using as many Fluentd features as possible (even if this package does not highlight it correctly)
|
||||
|
||||
## 1.0.0 (November 22, 2017)
|
||||
|
||||
NEW FEATURES:
|
||||
|
|
20
README.md
20
README.md
|
@ -1,6 +1,22 @@
|
|||
# Fluentd Config File language support in Atom
|
||||
# Fluentd Configuration language support in Atom
|
||||
|
||||
Adds basic syntax highlighting based on the [Sublime Text and TextMate package](https://github.com/adamchainz/fluentd.tmLanguage) to `fluent.conf` files in Atom.
|
||||
Adds basic syntax highlighting to `fluent.conf` based on the [Sublime Text and TextMate package](https://github.com/adamchainz/fluentd.tmLanguage) with some improvements in Atom.
|
||||
|
||||
![Screenshot](/screenshot.png?raw=true)
|
||||
|
||||
## Installation
|
||||
|
||||
Available as [Atom package](https://atom.io/packages/language-fluentd):
|
||||
|
||||
```
|
||||
apm install language-fluentd
|
||||
```
|
||||
|
||||
Or directly via git:
|
||||
|
||||
```
|
||||
git clone https://github.com/cmur2/language-fluentd.git ~/.atom/packages/language-fluentd
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
|
||||
# Receive events from 24224/tcp
|
||||
# This is used by log forwarding and the fluent-cat command
|
||||
<source>
|
||||
@type forward
|
||||
port 24224
|
||||
str1a_param "foo"
|
||||
str1b_param "foo
|
||||
bar"
|
||||
str2a_param 'foo'
|
||||
str2b_param 'foo
|
||||
bar'
|
||||
str2c_param "foo\nbar" # \n is interpreted as actual LF character
|
||||
array_param [
|
||||
"a", "b"
|
||||
]
|
||||
hash_param {
|
||||
"k": "v",
|
||||
"k1": 10
|
||||
}
|
||||
host_param "#{Socket.gethostname}" # host_param is actual hostname like `webserver1`.
|
||||
env_param "foo-#{ENV["FOO_BAR"]}" # NOTE that foo-"#{ENV["FOO_BAR"]}" doesn't work.
|
||||
tag "test.#{ENV['PROJECT_NAME']}"
|
||||
</source>
|
||||
|
||||
<source>
|
||||
@type tail
|
||||
@label @SYSTEM
|
||||
</source>
|
||||
|
||||
# http://this.host:9880/myapp.access?json={"event":"data"}
|
||||
<source>
|
||||
@type http
|
||||
port 9880
|
||||
</source>
|
||||
|
||||
<filter foo.bar>
|
||||
@type record_transformer
|
||||
<record>
|
||||
hostname "#{Socket.gethostname}"
|
||||
tag ${record["project_name"]}.scope.${tag}_old
|
||||
key.flatten x
|
||||
</record>
|
||||
</filter>
|
||||
|
||||
<match myapp.access yourapp.access>
|
||||
@type file
|
||||
path /var/log/fluent/access
|
||||
</match>
|
||||
|
||||
<label @SYSTEM>
|
||||
<filter var.log.middleware.**>
|
||||
@type grep
|
||||
# ...
|
||||
</filter>
|
||||
<match **>
|
||||
@type s3
|
||||
include_tag_key true
|
||||
buffer_chunk_limit 2M
|
||||
buffer_queue_limit 32
|
||||
flush_interval 5s
|
||||
# ...
|
||||
</match>
|
||||
</label>
|
||||
|
||||
<system>
|
||||
# equal to -qq option
|
||||
log_level error
|
||||
# equal to --without-source option
|
||||
without_source
|
||||
# ...
|
||||
</system>
|
||||
|
||||
# Include config files in the ./config.d directory
|
||||
@include config.d/*.conf
|
||||
|
||||
# =======================
|
||||
# v1_literal_example.conf
|
||||
# =======================
|
||||
<section1>
|
||||
key1 'text' # text
|
||||
key2 '\'' # ' (1 char)
|
||||
key3 '\\' # \ (1 char)
|
||||
key4 '\t' # \t (2 char)
|
||||
key5 '\[' # \[ (2 char)
|
||||
key6 '\\[' # \[ (2 char)
|
||||
key7 '#t' # #t (2 char)
|
||||
key8 '\#{test}' # \#{test} (8 char)
|
||||
key9 '#{test}' # #{test} (7 char)
|
||||
key10 '\[(?<time>[^\]]*)\] (?<message>.*)' # \[(?<time>[^\]]*\] (?<message>.*)
|
||||
</section1>
|
||||
<section2>
|
||||
key1 "text" # text
|
||||
key2 "\"" # " (1 char)
|
||||
key3 "\\" # \ (1 char)
|
||||
key4 "\t" # TAB (1 char)
|
||||
key5 "\[" # [ (1 char)
|
||||
key6 "\\[" # \[ (2 char)
|
||||
key7 "#t" # #t (2 char)
|
||||
key8 "\#{test}" # #{test} (7 char)
|
||||
key9 "#{test}" # replaced by eval('test')
|
||||
key10 "\\[(?<time>[^\\]]*)\\] (?<message>.*)" # \[(?<time>[^\]]*\] (?<message>.*)
|
||||
</section2>
|
||||
<section3>
|
||||
key1 text # text
|
||||
key2 \ # \ (1 char)
|
||||
key3 \\ # \\ (2 char)
|
||||
key4 \t # \t (2 char)
|
||||
key5 \[ # \[ (2 char)
|
||||
key6 \\[ # \\[ (3 char)
|
||||
key7 #t # #t (2 char)
|
||||
key8 \#{test} # \#{test} (8 char)
|
||||
key9 #{test} # #{test} (7 char)
|
||||
key10 \[(?<time>[^\]]*)\] (?<message>.*) # \[(?<time>[^\]]*\] (?<message>.*)
|
||||
</section3>
|
|
@ -1,44 +1,186 @@
|
|||
scopeName: 'source.fluentd'
|
||||
name: 'Fluentd Config File'
|
||||
name: 'Fluentd Configuration'
|
||||
fileTypes: [
|
||||
'fluent.conf'
|
||||
]
|
||||
foldingStartMarker: '<[^>]+>\\s*$'
|
||||
foldingStopMarker: '^\\s*</[^>]+>'
|
||||
|
||||
patterns: [
|
||||
{
|
||||
match: "#.*"
|
||||
name: "comment.line.number-sign.fluentd"
|
||||
}
|
||||
{
|
||||
match: "(<)(\\w+)(\\s([^>]+?))?(>)"
|
||||
name: "entity.tag.start.fluentd"
|
||||
captures:
|
||||
"1":
|
||||
name: "punctuation.definition.tag.fluentd"
|
||||
"2":
|
||||
name: "entity.tag.fluentd"
|
||||
"4":
|
||||
name: "entity.other.attribute-name.fluentd"
|
||||
"5":
|
||||
name: "punctuation.definition.tag.fluentd"
|
||||
}
|
||||
{
|
||||
match: "(</)(\\w+)(>)"
|
||||
name: "entity.tag.end.fluentd"
|
||||
captures:
|
||||
"1":
|
||||
name: "punctuation.definition.tag.fluentd"
|
||||
"2":
|
||||
name: "entity.tag.fluentd"
|
||||
"3":
|
||||
name: "punctuation.definition.tag.fluentd"
|
||||
}
|
||||
{
|
||||
match: "([^\\s]+)(\\s+([^\\n]+))?"
|
||||
name: "keyword.directive.generic.fluentd"
|
||||
captures:
|
||||
"1":
|
||||
name: "keyword.directive.fluentd"
|
||||
"3":
|
||||
name: "string.unquoted.fluentd"
|
||||
}
|
||||
{include: '#comments'}
|
||||
{include: '#directives'}
|
||||
]
|
||||
|
||||
repository:
|
||||
comments:
|
||||
patterns: [
|
||||
{
|
||||
match: '#.*'
|
||||
name: 'comment.line.number-sign.fluentd'
|
||||
}
|
||||
]
|
||||
directives:
|
||||
patterns: [
|
||||
{
|
||||
match: '((@)include)\\s+([^\\s]+)'
|
||||
captures:
|
||||
'1':
|
||||
name: 'entity.directive.begin.fluentd'
|
||||
'2':
|
||||
name: 'punctuation.definition.directive.begin.fluentd'
|
||||
'3':
|
||||
name: 'entity.other.directive.attribute-name.fluentd'
|
||||
}
|
||||
{
|
||||
begin: '((<)[^\\s]+(\\s+[^>]+)?(>))'
|
||||
beginCaptures:
|
||||
'1':
|
||||
name: 'entity.directive.begin.fluentd'
|
||||
'2':
|
||||
name: 'punctuation.definition.directive.begin.fluentd'
|
||||
'3':
|
||||
name: 'entity.other.directive.attribute-name.fluentd'
|
||||
'4':
|
||||
name: 'punctuation.definition.directive.end.fluentd'
|
||||
end: '((</)\\w+(>))'
|
||||
endCaptures:
|
||||
'1':
|
||||
name: 'entity.directive.end.fluentd'
|
||||
'2':
|
||||
name: 'punctuation.definition.directive.begin.fluentd'
|
||||
'3':
|
||||
name: 'punctuation.definition.directive.end.fluentd'
|
||||
name: 'meta.directive.fluentd'
|
||||
patterns: [
|
||||
{include: '#comments'}
|
||||
{include: '#directives'}
|
||||
{include: '#parameters'}
|
||||
]
|
||||
}
|
||||
]
|
||||
parameters:
|
||||
patterns: [
|
||||
{
|
||||
begin: '(@[^\\s]+)|([^\\s]+)'
|
||||
beginCaptures:
|
||||
'1':
|
||||
name: 'keyword.parameter.system.fluentd'
|
||||
'2':
|
||||
name: 'keyword.parameter.fluentd'
|
||||
end: '\\n'
|
||||
name: 'meta.parameter.fluentd'
|
||||
patterns: [
|
||||
{include: '#comments'}
|
||||
{include: '#values'}
|
||||
]
|
||||
}
|
||||
]
|
||||
values:
|
||||
patterns: [
|
||||
{
|
||||
match: '\\\\.'
|
||||
name: 'value.string.escape.fluentd'
|
||||
}
|
||||
{
|
||||
begin: '(")'
|
||||
beginCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.string.begin.fluentd'
|
||||
end: '(")'
|
||||
endCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.string.end.fluentd'
|
||||
name: 'meta.value.string.quoted.double.fluentd'
|
||||
patterns: [
|
||||
{include: '#stringescapes'}
|
||||
{include: '#stringinterpolations'}
|
||||
]
|
||||
}
|
||||
{
|
||||
begin: "(')"
|
||||
beginCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.string.begin.fluentd'
|
||||
end: "(')"
|
||||
endCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.string.end.fluentd'
|
||||
name: 'meta.value.string.quoted.single.fluentd'
|
||||
patterns: [
|
||||
{include: '#stringescapes'}
|
||||
]
|
||||
}
|
||||
{
|
||||
begin: '(\\[)'
|
||||
beginCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.array.begin.fluentd'
|
||||
end: '(\\])'
|
||||
endCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.array.end.fluentd'
|
||||
name: 'meta.value.array.fluentd'
|
||||
patterns: [
|
||||
{include: 'source.json'}
|
||||
]
|
||||
}
|
||||
{
|
||||
begin: '\\{'
|
||||
beginCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.hash.begin.fluentd'
|
||||
end: '\\}'
|
||||
endCaptures:
|
||||
'1':
|
||||
name: 'punctuation.definition.hash.end.fluentd'
|
||||
name: 'meta.value.hash.fluentd'
|
||||
patterns: [
|
||||
{include: 'source.json'}
|
||||
]
|
||||
}
|
||||
{
|
||||
match: '\/.+\/$'
|
||||
name: 'value.string.regex.fluentd'
|
||||
}
|
||||
{
|
||||
match: '\\b(\\d+)\\b'
|
||||
name: 'value.constant.integer.fluentd'
|
||||
}
|
||||
{
|
||||
match: '\\b(\\d+[kmgtKMGT])\\b'
|
||||
name: 'value.constant.size.fluentd'
|
||||
}
|
||||
{
|
||||
match: '\\b(\\d+[smhd])\\b'
|
||||
name: 'value.constant.time.fluentd'
|
||||
}
|
||||
{
|
||||
match: '(\\$\\{[^\\}]*\\})'
|
||||
name: 'variable.string.fluentd'
|
||||
}
|
||||
{
|
||||
match: '([^\\s]+?)'
|
||||
name: 'meta.string.unquoted.fluentd'
|
||||
captures:
|
||||
'1':
|
||||
name: 'string.unquoted.fluentd'
|
||||
}
|
||||
]
|
||||
stringescapes:
|
||||
patterns: [
|
||||
{
|
||||
match: '\\\\.'
|
||||
name: 'constant.string.escape.fluentd'
|
||||
}
|
||||
]
|
||||
stringinterpolations:
|
||||
patterns: [
|
||||
{
|
||||
begin: '#\\{'
|
||||
end: '\\}'
|
||||
name: 'constant.string.interpolation.fluentd'
|
||||
patterns: [
|
||||
{include: 'source.ruby'}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
11
package.json
11
package.json
|
@ -1,7 +1,14 @@
|
|||
{
|
||||
"name": "language-fluentd",
|
||||
"description": "Fluentd Config File language support in Atom",
|
||||
"version": "1.0.0",
|
||||
"description": "Fluentd Configuration language support in Atom",
|
||||
"version": "1.1.3",
|
||||
"keywords": [
|
||||
"language",
|
||||
"grammar",
|
||||
"fluentd",
|
||||
"configuration",
|
||||
"logging"
|
||||
],
|
||||
"engines": {
|
||||
"atom": "*"
|
||||
},
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
|
@ -0,0 +1,3 @@
|
|||
'.source.fluentd':
|
||||
editor:
|
||||
commentStart: '# '
|
Loading…
Reference in New Issue