情况:
每日导入.sh
docker exec -it $DOCKER_CONTAINER_NAME opt/logstash/bin/logstash --path.data /tmp/logstash/data -e \
'input {
file {
path => "'$OUTPUT_PATH'"
start_position => "beginning"
sincedb_path => "/dev/null"
mode => "read"
file_completed_action => "delete"
}
}
filter {
csv {
separator => ","
columns => ["foo", "bar", "foo2", "bar2"]
}
}
output {
elasticsearch{
hosts => "localhost:9200"
index => "foo"
document_type => "foo"
}
stdout …Run Code Online (Sandbox Code Playgroud) 我已经按照 Vuejs 网站上的文档学习了如何全局注册 vue 组件。
我已经定义了组件文件夹的相对路径./global并设置为在子文件夹中查找true(默认为 false)。但是,它仍然不会查看子文件夹。
我还对组件键进行了 console.logged 以查看是否包含任何 vue 组件,但它只返回全局(根)文件夹中的组件。
https://vuejs.org/v2/guide/components-registration.html
import Vue from 'vue'
import upperFirst from 'lodash/upperFirst'
import camelCase from 'lodash/camelCase'
const requireComponent = require.context(
// The relative path of the components folder
'./global',
// Whether or not to look in subfolders
true,
// The regular expression used to match base component filenames
/[A-Z]\w+\.(vue|js)$/
)
console.log(requireComponent.keys())
requireComponent.keys().forEach(fileName => {
// Get component config
const componentConfig = requireComponent(fileName)
// Get PascalCase name of …Run Code Online (Sandbox Code Playgroud) 我无法连接到我的Nuxt.js应用OUTSIDE流浪盒(亦称我的主机或本地机),但它能够检索内容INSIDE的流浪汉框。
所以...
我正在使用 Laravel Homestead 来托管我的 Nuxt.js 应用程序,并在 vagrant 框内启动服务器
nuxt start --public 0.0.0.0:3000
Run Code Online (Sandbox Code Playgroud)
我可以确认它正在运行,并且一条消息显示它正在侦听localhost:3000并
curl localhost:3000返回应用程序内容。
我还检查了我的homestead.yaml配置,并在那里设置了端口转发。
ip: "192.168.10.10"
memory: 8192
cpus: 4
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: D:/Developments
to: /home/vagrant/projects
sites:
- map: homestead.test
to: /home/vagrant/projects/public
databases:
- homestead
ports:
- send: 9200
to: 9200
- send: 5601
to: 5601
- send: 3000
to: 3000
Run Code Online (Sandbox Code Playgroud)
我做错了什么?Elasticsearch 和 Kibana 等其他应用程序似乎运行良好,可以在我的本地/主机上访问。
我试图按日期对单位值求和,并创建一个没有重复日期的新数组。例如,我想计算2015-12-04 00:01:00. 此日期在以下数据中出现了 2 次,其值为5和6,将是:
[{date: '2015-12-04 00:01:00', unit: 11}, ... etc]
Run Code Online (Sandbox Code Playgroud)
我试过,arr = results.map(x => x.unit).reduce((a,c) => a + c)但它只返回一个值,而不是一个数组。
[{date: '2015-12-04 00:01:00', unit: 11}, ... etc]
Run Code Online (Sandbox Code Playgroud)
javascript ×2
vue.js ×2
arrays ×1
dictionary ×1
docker ×1
ecmascript-6 ×1
homestead ×1
kibana ×1
laravel ×1
logstash ×1
nuxt.js ×1
reduce ×1
vagrant ×1
webpack ×1