.net core 与ELK(3)安装Kibana

1.去产品官网下载https://www.elastic.co/downloads/kibana 对应的tar.gz的压缩包,放到/usr/local/src目录node

2.解压linux

tar -xzvf kibana-6.4.0-linux-x86_64.tar.gz -C /usr/local

3.进入到config目录下,进行kibana.yml文件配置 配置端口号,服务器地址,es的地址服务器

4.kibana启动spa

bin目录下.net

 ./kibana &

5.testcode

6.netcore 新建索引blog

新建控制台项目,引入NEST包索引

Democi

using Nest;
using System;

namespace els
{
    class Program
    {
        static void Main(string[] args)
        {
            var node = new Uri("http://10.2.2.139:9200/");
            var settings = new ConnectionSettings(node);
            var client = new ElasticClient(settings);

            var tweet = new Tweet
            {
                Id = 2,
                User = "kimchy",
                PostDate = new DateTime(2009, 11, 15),
                Message = "Trying out NEST, so far so good?"
            };
            var response = client.Index(tweet, idx => idx.Index("test")); //or specify index via settings.DefaultIndex("mytweetindex");
        }
    }
    class Tweet
    {
        public int Id { get; set; }
        public string User { get; set; }
        public DateTime PostDate { get; set; }
        public string Message { get; set; }
    }
}

7.kibana新建index partnerget

8.kibana查看

相关文章
相关标签/搜索