[[inputs.file]]
files = ["c:/programs/telegraf/test.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "component"
[[inputs.file.json_v2.object]]
path = "data.component"
optional = true
tags = ["tag"]
disable_prepend_keys = true
[[outputs.file]]
files = ["stdout"]
PS C:\programs\telegraf\telegraf-1.32.0> .\telegraf.exe --config .\telegraf.conf --once
2024-10-02T14:05:05Z I! Loading config: .\telegraf.conf
2024-10-02T14:05:05Z I! Starting Telegraf 1.32.0 brought to you by InfluxData the makers of InfluxDB
2024-10-02T14:05:05Z I! Available plugins: 235 inputs, 9 aggregators, 32 processors, 26 parsers, 62 outputs, 5 secret-stores
2024-10-02T14:05:05Z I! Loaded inputs: file
2024-10-02T14:05:05Z I! Loaded aggregators:
2024-10-02T14:05:05Z I! Loaded processors:
2024-10-02T14:05:05Z I! Loaded secretstores:
2024-10-02T14:05:05Z I! Loaded outputs: file
2024-10-02T14:05:05Z I! Tags enabled: host=pc
2024-10-02T14:05:05Z I! [agent] Hang on, flushing any cached metrics before shutdown
component,host=pc,tag=tag1 name="name1",value="a100" 1727877906000000000
component,host=pc,tag=tag2 name="name1",value="b100" 1727877906000000000
component,host=pc,tag=tag2 name="name2",value="b200" 1727877906000000000
2024-10-02T14:05:05Z I! [agent] Stopping running outputs
(get-content file.txt -raw) -replace "1","2" -replace "3","4" -replace "5","6" | out-file file.txt
$pairs = import-csv csvfile.txt
$filecontent = get-content file.txt -raw
foreach ($pair in $pairs) { $filecontent =$filecontent -replace $pair.oldword,$pair.newword }
set-content file.txt -value $filecontent
proc.cpu.util[<name>,<user>,<type>,<cmdline>,<mode>,<zone>]
reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:64
reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:32
$x=gc *.html
for ($i=0; $i -le $x.Length; $i++) {
if ((ConvertFrom-Csv -Delimiter "," -Header "a","b","c","d","e","f" -inputobject $x[$i]).b -eq "38" -and (ConvertFrom-Csv -Delimiter "," -Header "a","b","c","d","e","f" -inputobject $x[$i+1]).b -eq "156" ) {
echo $x[$i] $x[$i+1]
}
}
http-request set-path %[path,lower]
http-request set-query %[query,lower]
http-request set-uri https://%[req.hdr(Host),lower]%[path,lower]?%[query,lower]
http-request redirect code 301 location https://%[hdr(host),lower]%[capture.req.uri,lower]
server BACKEND_SERVER IP:443 ssl verify none