question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
source_dataset = tf.data.TextLineDataset('primary.csv') target_dataset = tf.data.TextLineDataset('secondary.csv') dataset = tf.data.Dataset.zip((source_dataset, target_dataset)) dataset = dataset.shard(10000, 0) dataset = dataset.map(lambda source, target: (tf.string_to_number(tf.string_split([source], delimiter=',').v...
I was working with tf.data.FixedLengthRecordDataset() and ran into a similar problem. In my case, I was trying to only take a certain percentage of the raw data. Since I knew all the records have a fixed length, a workaround for me was: totalBytes = sum([os.path.getsize(os.path.join(filepath, filename)) for filename in...
DataSet
47,735,896
10
I have a very big table of time series data that have these columns: Timestamp LicensePlate UberRide# Speed Each collection of LicensePlate/UberRide data should be processed considering the whole set of data. In others words, I do not need to proccess the data row by row, but all rows grouped by (LicensePlate/UberRid...
What you are looking for exists since Spark 2.3: Pandas vectorized UDFs. It allows to group a DataFrame and apply custom transformations with pandas, distributed on each group: df.groupBy("groupColumn").apply(myCustomPandasTransformation) It is very easy to use so I will just put a link to Databricks' presentation of ...
DataSet
39,600,160
10
I´m tryng to make a bar chart in chart.js (using chart.js 2.2.2) I´m in trouble trying to put new datasets in a chart How can i put a new Dataset "Vendas" with data: [10,20,30,40,50,60,70] var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { ...
Since you store your chart data in a variable (called data in your code), you can do it with a simple function on a button : $('button').click(function() { // You create the new dataset `Vendas` with new data and color to differentiate var newDataset = { label: "Vendas", backgroundColor: 'rgba(9...
DataSet
39,475,891
10
I'm currently working on a project using sigma.js where I need to show a large number of nodes and edges (~10000 to ~100000 of each one) stored in a JSON file. But the library is getting laggy when I load the JSON, on each refresh and also when it shows me the graph it doesn't space the nodes. I was wondering if someon...
To be honest i am on the same issue if it can helps, i think the book example of Gephi.org tutorial is still the best. For the moment i am on including sigmaJS from cloudflare but i don't have any proposition for this. Something like you replace the library with a link to cloudflare like the one used for phaser.io exp...
DataSet
36,543,964
10
I'm trying to create a local SQL Server Reporting Services report (.rdlc file) and connect this report to some data sets that I generate in code (no direct SQL Server connection). I create a ReportDataProvider class with some instance methods that return IList<T> for various sets of criteria - but I cannot seem to find...
I do some research, and try different ways to add classes. Unfortunatly it happends that you can't see static classes in this designer. I tried different ways but no luck. For non static classes this manual works for me every time, even with Interfaces like IList, but i don't represent it here: Make sure that namespac...
DataSet
27,227,560
10
In ggplot2's built-in mpg dataset there is variable called "fl.", which is a factor with levels: "c", "d", "e", "p", & "r". Does anyone know what those letters are supposed to stand for? Needless to say, googling those letters has yet to give me any relevant leads... library(ggplot2) data(mpg) str(mpg) ?mpg [Note: Th...
The fuel: e: ethanol E85, note(subset(mpg, fl=="e") pulls up only "new" american cars, and that fuel economy is much lower than the corresponding presumably gasoline models, which lines up with the lower energy content of ethanol) d: diesel r: regular p: premium c: CNG (note as far as I know the civic is basically the...
DataSet
25,548,656
10
I have a dataset wherein I am trying to determine the number of risk factors per person. So I have the following data: Person_ID Age Smoker Diabetes 001 30 Y N 002 45 N N 003 27 N Y 004 18 Y Y 005 55 Y Y Ea...
I would do this the following way. For each column, create a new boolean series using the column's condition Add those series row-wise (Note that this is simpler if your Smoker and Diabetes column is already boolean (True/False) instead of in strings.) It might look like this: df = pd.DataFrame({'Age': [30,45,27,18,...
DataSet
24,810,526
10
I need to read a data file into R for my assignment. You can download it from the following site. http://archive.ics.uci.edu/ml/datasets/Acute+Inflammations The data file ends with an extension .data which I never see before. I tried read.table and alike but could not read it into R properly. Can anyone help me with t...
It's a UTF-16 little endian file with a byte order mark at the beginning. read.table will fail unless you specify the correct encoding. This works for me on MacOS. Decimals are indicated by a comma. read.table("diagnosis.data", fileEncoding="UTF-16", dec=",") V1 V2 V3 V4 V5 V6 V7 V8 1 35.5 no yes no ...
DataSet
21,101,927
10
Now I use method in C# to read table from SQLite database into DataTable, but I want to send all table into other object. So I think I have to use DataSet to combine all DataTable(s) and send it to object as parameter. Is there method that easy read all tables from SQLite database to DataSet? Or I have to read all tabl...
The sql for listing all the tables is: SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY 1 you could then get all the tables as databases seperately and then add them into a dataset - an example here: http://www.dotnetperls.com/dataset so i guess the code would be something like: Dataset d = new Dataset() f...
DataSet
20,256,043
10
How would one add a legend to the multiline series chart? I tried but am not getting any legend to display. The block here: http://bl.ocks.org/3884955 has a flaw when the various series converge to the same point, like zero. All the labels will be overlayed on each other. Instead of going for these labels, a traditiona...
Here is a fixed & refactored version of your code. var legend = svg.selectAll('g') .data(cities) .enter() .append('g') .attr('class', 'legend'); legend.append('rect') .attr('x', width - 20) .attr('y', function(d, i){ return i * 20;}) .attr('width', 10) ...
DataSet
14,775,962
10
In DataTable I could sorting with dataTable.DefaultView.Sort = "SortField DESC"; I'm getting a DataSet from database, I was wondering could I do a sorting on the DataSet like how I do it in DataTable.
you can still access the DataTable from the the data set as follows, ds.Tables[0].DefaultView.Sort =" criterian"; Hope this helps.
DataSet
11,029,823
10
I want to read some quite huge files(to be precise: the google ngram 1 word dataset) and count how many times a character occurs. Now I wrote this script: import fileinput files = ['../../datasets/googlebooks-eng-all-1gram-20090715-%i.csv' % value for value in range(0,9)] charcounts = {} lastfile = '' for line in filei...
I do not know why fileinput does not work as expected. I suggest you use the open function instead. The return value can be iterated over and will return lines, just like fileinput. The code will then be something like: for filename in files: print(filename) for filelineno, line in enumerate(open(filename, enco...
DataSet
5,493,073
10
I am working with a windows application. I load a dataset with dataadapter with fill method.(objDataAdaptere.fill(objDataSet,"string")) Now I want to get a cell of this dataset.(for example (row(0),cell(0))) How do I can do this? Thanks.
The value? Assuming you mean "of the first table of the data-set", then: object value = dataSet.Tables[0].Rows[0][0]; but more specifically: object value = dataSet.Tables[tableIndex].Rows[rowIndex][colIndex];
DataSet
4,332,826
10
I am building a demo dataset for my webapp. I would like thousands of "real looking" names. They should not be names of famous people or fiction heroes or names that will evoke associations. They should all have various and different sounding but realistic male and female names and surnames. Birth dates and other data ...
There are websites which will generate fake names for you. I usually use fakenamegenerator.com but I think that only does one person at a time. identitygenerator.com has a tool which which will generate a large number of random names - and other personal information - downloadable in various formats.
DataSet
2,378,509
10
I have tried executing this docker command to setup Jaeger Agent and jaeger collector with elasticsearch. sudo docker run \ -p 5775:5775/udp \ -p 6831:6831/udp \ -p 6832:6832/udp \ -p 5778:5778 \ -p 16686:16686 \ -p 14268:14268 \ -e SPAN_STORAGE_TYPE=elasticsearch \ --name=jaeger \ jaegertracing/all-in-one:latest but...
After searching a solution for some time, I found a docker-compose.yml file which had the Jaeger Query,Agent,collector and Elasticsearch configurations. docker-compose.yml version: "3" services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:6.3.1 networks: - elastic-jaeger ...
OpenTracing
51,785,812
18
I'm trying to use OpenTracing.Contrib.NetCore with Serilog. I need to send to Jaeger my custom logs. Now, it works only when I use default logger factory Microsoft.Extensions.Logging.ILoggerFactory My Startup: public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(Co...
This is a limitation in the Serilog logger factory implementation; in particular, Serilog currently ignores added providers and assumes that Serilog Sinks will replace them instead. So, the solutions is implementaion a simple WriteTo.OpenTracing() method to connect Serilog directly to OpenTracing public class OpenTraci...
OpenTracing
56,156,809
18
I instrumented a simple Spring-Boot application with Jaeger, but when I run the application within a Docker container with docker-compose, I can't see any traces in the Jaeger frontend. I'm creating the tracer configuration by reading the properties from environment variables that I set in the docker-compose file. This...
I found the solution to my problem, in case anybody is facing similar issues. I was missing the environment variable JAEGER_SAMPLER_MANAGER_HOST_PORT, which is necessary if the (default) remote controlled sampler is used for tracing. This is the working docker-compose file: version: '2' services: demo: ...
OpenTracing
50,173,643
11
There is an existing Spring Boot app which is using SLF4J logger. I decided to add the support of distributed tracing via standard opentracing API with Jaeger as the tracer. It is really amazing how easy the initial setup is - all that is required is just adding two dependencies to the pom.xml: <dependency> ...
https://github.com/opentracing-contrib/java-spring-cloud project automatically sends standard logging to the active span. Just add the following dependency to your pom.xml <dependency> <groupId>io.opentracing.contrib</groupId> <artifactId>opentracing-spring-cloud-starter</artifactId> </dependency> Or use this ht...
OpenTracing
50,855,480
11
The W3C trace context defines the traceparent and tracestate headers for enabling distributed tracing. My question(s) is then How is it different from OpenTracing. If W3C has already defined usage of the headers, then is opentracing using some other headers?
OpenTracing, by design, did not define a format for propagating tracing headers. It was the responsibility of libraries who implemented OpenTracing to provide their own format for serialization/de-serialization of the span context. This was mostly an effort to be as broadly compatible as possible. Generally, you'll fin...
OpenTracing
62,304,436
11
I set up a hbase cluster to store data from opentsdb. Recently due to reboot of some of the nodes, hbase lost the table "tsdb". I can still it on hbase's master node page, but when I click on it, it gives me a tableNotFoundException org.apache.hadoop.hbase.TableNotFoundException: tsdb at org.apache.hadoop.hbase.cli...
A bit late, maybe it's helpful to the searcher. Run the ZooKeeper shell hbase zkcli In the shell run ls /hbase/table Run rmr /hbase/table/TABLE_NAME Restart Hbase
OpenTSDB
10,586,246
18
I am trying to install OpenTSDB on Ubuntu, and I am following this documentation. But after running these commands: git clone git://github.com/OpenTSDB/opentsdb.git cd opentsdb running this commanding is giving the following console output: ./build.sh Console Output: seed-admin@seedadmin-Inspiron-3847:~/Abharthan/ope...
sudo apt-get install autoconf solved my problem
OpenTSDB
32,255,654
17
We are trying to use HBase to store time-series data. The model we have currently stores the time-series as versions within a cell. This implies that the cell could end up storing millions of versions, and the queries on this time-series would retrieve a range of versions using the setTimeRange method available on the ...
I don't think you should use versioning to store the time series here. Not because it won't work, but because it's not designed for that particular use case and there are other ways. I suggest you store the time series as the time step as the column qualifier and the value will be the data itself. Something like: { ...
OpenTSDB
4,126,259
15
I used OpenTSDB over HBase (pseudo-distributed Hadoop on virtual box) to send data at very high load (~ 50,000 records / s). The system worked properly for a while but it went down suddenly. I terminated OpenTSDB and HBase. Unfortunately, I could never bring them up again. Every time I tried to run HBase and OpenTSDB, ...
According to HBASE-13329, a short type overflow has occurred with "short diffIdx = 0" in hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java. A patch has been available today (2015-07-06). In the patch, HBase developers change the declaration from "short diffIdx = 0" to "int diffIdx = 0". I did tests...
OpenTSDB
31,164,505
12
I'm using Qt4 to post some data points to a OpenTSDB server, which doesn't supports chunked HTTP requests. The code is basically this: QNetworkRequest request(m_url); request.setHeader(QNetworkRequest::ContentTypeHeader, QString("application/json")); request.setHeader(QNetworkRequest::ContentLengthHeader, jsonRequest.t...
I've finally found the reason it thinks my request is chunked: OpenTSDB internally uses Netty for networking, and if Netty reads a block that doesn't contain the complete request, then it's flagged as chunked, even if there's no Transfer-Encoding header in the request. There are two possible solutions for this: adding...
OpenTSDB
27,841,071
10
I'm building a one-off smart-home data collection box. It's expected to run on a raspberry-pi-class machine (~1G RAM), handling about 200K data points per day (each a 64-bit int). We've been working with vanilla MySQL, but performance is starting to crumble, especially for queries on the number of entries in a given ti...
InfluxDB should be fine with 1 GB RAM at that volume. Embedded sensors and low-power devices like Raspberry Pi's are definitely a core use case, although we haven't done much testing with the latest betas beyond compiling on ARM. InfluxDB 0.9.0 was just released, and 0.9.x should be available in our Hosted environment...
OpenTSDB
30,930,390
10
In the following regex what does "(?i)" and "?@" mean? (?i)<.*?@(?P<domain>\w+\.\w+)(?=>) I know that "?" means zero or one and that i sets case insensitivity. This regex captures domains from an email address in a mailto field, but does not include the @ sign. It was generated the erex command from within SPLUNK 6.0....
demo here : https://regex101.com/r/hE9gB4/1 (?i)<.*?@(?P<domain>\w+\.\w+)(?=>) its actually getting your domain name from the email id: (?i) makes it match case insensitive and ?@ is nothing but @ which matches the character @ literally. the ? in your ?@ is part of .*? which we call as a lazy operator, It will give yo...
Splunk
22,961,535
36
I'm pushing my logs to a local splunk installation. Recently I found that the following error repeats a lot (about once every minute): Error L10 (output buffer overflow): 7150 messages dropped since 2013-06-26T19:19:52+00:00.134 <13>1 2013-07-08T14:59:47.162084+00:00 host app web.1 - [\x1B[37minfo\x1B[0m] applic...
After a long ping-pong with the Heroku team, we found the answer: I used the URL prefix http:// when configuring the log drain, instead of syslog://. When I changed the URL to syslog://, the error went away, and logs are correctly flowing through splunks.
Splunk
17,532,337
14
I'm using the Splunk HttpEventCollectorLogbackAppender to automatically send application logs to Splunk. I've been trying to set the host, source, and sourcetype but am not having any luck getting them sent to Splunk. Is it possible to set the host, source, or sourcetype using the Splunk HttpEventCollectorLogbackAppend...
Any setters on HttpEventCollectorLogbackAppender can be added to your logback configuration. So to invoke setHost, setSource and setSourcetype you add them to your logback configuration like this: <appender name="SPLUNK" class="com.splunk.logging.HttpEventCollectorLogbackAppender"> <url>http://myurl:8088</url> ...
Splunk
41,005,325
10
I need to ship my cloudwatch logs to a log analysis service. I've followed along with these articles here and here and got it working by hand, no worries. Now I'm trying to automate all this with Terraform (roles/policies, security groups, cloudwatch log group, lambda, and triggering the lambda from the log group). B...
I had the aws_cloudwatch_log_subscription_filter resource defined incorrectly - you should not provide the role_arn argument in this situation. You also need to add an aws_lambda_permission resource (with a depends_on relationship defined on the filter or TF may do it in the wrong order). Note that the AWS lambda conso...
Sumo Logic
38,407,660
40
Is it possible to query for a distinct/unique count of a field using Kibana? I am using elastic search as my backend to Kibana. If so, what is the syntax of the query? Heres a link to the Kibana interface I would like to make my query: http://demo.kibana.org/#/dashboard I am parsing nginx access logs with logstash and...
For Kibana 4 go to this answer This is easy to do with a terms panel: If you want to select the count of distinct IP that are in your logs, you should specify in the field clientip, you should put a big enough number in length (otherwise, it will join different IP under the same group) and specify in the style table. ...
Logstash
19,102,220
78
I am building a proof of concept using Elasticsearch Logstash and Kibana for one of my projects. I have the dashboard with the graphs working without any issue. One of the requirements for my project is the ability to download the file(csv/excel). In kibana the only option i saw for downloading the file is by clicking...
FYI : How to download data in CSV from Kibana: In Kibana--> 1. Go to 'Discover' in left side Select Index Field (based on your dashboard data) (*** In case if you are not sure which index to select-->go to management tab-->Saved Objects-->Dashboard-->select dashboard name-->scroll down to JSON-->you will see the Inde...
Logstash
34,792,146
74
I am using ELK to create dashboards from my log files. I have a log file with entries that contain an id value and a "success"/"failure" value, displaying whether an operation with a given id succeeded or failed. Each operation/id can fail an unlimited number of times and succeed at most once. In my Kibana dashboard I ...
This is easy in Kibana 5 search bar. Just add a filter !(_exists_:"your_variable") you can toggle the filter or write the inverse query as _exists_:"your_variable" In Kibana 4 and Kibana 3 you can use this query which is now deprecated _missing_:"your_variable" NOTE: In Elasticsearch 7.x, Kibana now has a pul...
Logstash
27,537,521
68
In one of my project, I am planning to use ElasticSearch with MySQL. I have successfully installed ElasticSearch. I am able to manage index in ES separately. but I don't know how to implement the same with MySQL. I have read a couple of documents but I am a bit confused and not having a clear idea.
As of ES 5.x , they have given this feature out of the box with logstash plugin. This will periodically import data from database and push to ES server. One has to create a simple import file given below (which is also described here) and use logstash to run the script. Logstash supports running this script on a sched...
Logstash
36,152,152
66
What are the main differences between Graylog2 and Kibana? We already use Graylog2 but I must admit I don't really like the UI. Just wonder in case it may be helpful to switch to Kibana.
At my company we started with Graylog2 and recently installed Kibana3. My personal opinion is that Kibana3 is more suited towards non-dev, while Graylog isn't. Kibana: Pretty dashboards Graphs, charts and images "panel" customization, adding parallel coordinate graphs for example Easy/flexible management of dashboards...
Logstash
17,210,184
46
I have a field that contains numbers. I want a filter that shows all logs that are less than a constant value. When I try to add a new query filter, all I can see is a query string option.
If you are talking about the query field a syntax like this works: field:<10 Will find just records with a field value less than 10. Found this by experimentation one day -- don't know if it's documented anywhere.
Logstash
26,303,899
43
Ultimately I want to have a scalable search solution for the data in PostgreSql. My finding points me towards using Logstash to ship write events from Postgres to ElasticSearch, however I have not found a usable solution. The soluions I have found involve using jdbc-input to query all data from Postgres on an interval,...
If you need to also be notified on DELETEs and delete the respective record in Elasticsearch, it is true that the Logstash jdbc input will not help. You'd have to use a solution working around the binlog as suggested here However, if you still want to use the Logstash jdbc input, what you could do is simply soft-delete...
Logstash
35,813,923
40
I have the many of my logs indexed in logstash-Year-Week format. That is if i want to delete indices older than a few weeks, how can I achieve that in elasticsearch. Is there an easy, seamless way to do that?
Curator would be an ideal match here. You can find the link here - https://github.com/elastic/curator A command like below should work just fine - curator --host <IP> delete indices --older-than 30 --prefix "twitter-" --time-unit days --timestring '%Y-%m-%d' You can keep in this in the CRON for removing the indices ...
Logstash
33,430,055
39
I have web application backed end in NodeJS and logstash/elasticsearch/kibana to handle system logs like (access_error.log, messages.log etc). Right now I need to record all JavaScript client side errors into kibana also. What is the best way to do this? EDIT: I have to add additional information to this question. As @...
When you say client, I'm assuming here that you mean a logging client and not a web client. First, make it a habit to log your errors in a common format. Logstash likes consistency, so if you're putting text and JSON in the same output log, you will run into issues. Hint: log in JSON. It's awesome and incredibly fl...
Logstash
24,502,190
38
We started using Serilog in combination with Elasticsearch, and it's a very efficient way to store structure log data (and later visualize them using tools like Kibana). However, I see the advantage of not writing log data directly to the backend but instead configure a log broker such as Logstash that can take respons...
The accepted answer was written before the sink Serilog.Sinks.Http existed. Instead of logging to file and having Filebeat monitoring it, one could have the HTTP sink post log events to the Logstash HTTP input plugin. This would mean fewer moving parts on the instances where the logs where created.
Logstash
25,283,749
38
In my system, the insertion of data is always done through csv files via logstash. I never pre-define the mapping. But whenever I input a string it is always taken to be analyzed, as a result an entry like hello I am Sinha is split into hello,I,am,Sinha. Is there anyway I could change the default/dynamic mapping of el...
Just create a template. run curl -XPUT localhost:9200/_template/template_1 -d '{ "template": "*", "settings": { "index.refresh_interval": "5s" }, "mappings": { "_default_": { "_all": { "enabled": true }, "dynamic_templates": [ ...
Logstash
27,483,302
37
Does logstash use its own file syntax in config file? Is there any parser or validator for config file syntax? For anyone that does not use logstash but have idea about file formats here is a sample syntax: input { file { path => "/var/log/messages" type => "syslog" } file { path => "/var/log/apache/...
The Logstash configuration file is a custom format developed by the Logstash folks using Treetop. The grammar itself is described in the source file grammar.treetop and compiled using Treetop into the custom grammar.rb parser. That parser is then used by the pipeline.rb file in order to set up the pipeline from the Log...
Logstash
21,442,715
36
I am trying to run ElasticSearch with Kibana in Windows 2008 R2. I followed this article: Install-logstash-on-a-windows-server-with-kibana Step by step, but all I get is: Connection Failed Possibility #1: Your elasticsearch server is down or unreachable This can be caused by a network outage, or a failure of the Elast...
I have faced similar kind of issue. If you are using elasticsearch-1.4 with Kibana-3 then add following parameters in elasticsearch.yml file http.cors.allow-origin: "/.*/" http.cors.enabled: true Reference, https://gist.github.com/rmoff/379e6ce46eb128110f38
Logstash
26,828,099
36
I have a remote machine that combines multiline events and sends them across the lumberjack protocol. What comes in is something that looks like this: { "message" => "2014-10-20T20:52:56.133+0000 host 2014-10-20 15:52:56,036 [ERROR ][app.logic ] Failed to turn message into JSON\nTraceback (most recent call l...
All GREEDYDATA is is .*, but . doesn't match newline, so you can replace %{GREEDYDATA:message} with (?<message>(.|\r|\n)*)and get it to be truly greedy.
Logstash
26,474,873
34
I'm trying to parse a logfile using grok Each line of the logfile has fields separated by commas: 13,home,ABC,Get,,Private, Public,1.2.3 ecc... I'm using match like this: match => [ "message", "%{NUMBER:requestId},%{WORD:ServerHost},%{WORD:Service},... My question is: Can I allow optional field? At times some of the f...
At it's base, grok is based on regular expressions, so you can surround a pattern with ()? to make it optional -- for example (%{NUMBER:requestId})?, If there isn't a grok pattern that suits your needs, you can always create a named extraction like this: (?<version>[\d\.]+) which would extract into version, a string th...
Logstash
30,083,719
32
I am exploring ELK stack and coming across an issue. I have generated logs, forwarded the logs to logstash, logs are in JSON format so they are pushed directly into ES with only JSON filter in Logstash config, connected and started Kibana pointing to the ES. Logstash Config: filter { json { source => "message" ...
You've updated the Kibana field list? Kibana. Settings. Reload field list. Newer version: Kibana. Management. Refresh icon on the top right.
Logstash
30,471,859
31
Is there any way in logstash to use a conditional to check if a specific tag exists? For example, grok { match => [ "message", "Some expression to match|%{GREEDYDATA:NOMATCHES}" ] if NOMATCHES exists Do something. How do I verify if NOMATCHES tag exists or not? Thanks.
Just so we're clear: the config snippet you provided is setting a field, not a tag. Logstash events can be thought of as a dictionary of fields. A field named tags is referenced by many plugins via add_tag and remove_tag operations. You can check if a tag is set: if "foo" in [tags] { ... } But you seem to want to ...
Logstash
21,438,697
29
Background: I have a custom generated log file that has the following pattern : [2014-03-02 17:34:20] - 127.0.0.1|ERROR| E:\xampp\htdocs\test.php|123|subject|The error message goes here ; array ( 'create' => array ( 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' ), ) [2014-03-02 17:34:20]...
I went through the source code and found out that : The multiline filter will cancel all the events that are considered to be a follow up of a pending event, then append that line to the original message field, meaning any filters that are after the multiline filter won't apply in this case The only event that will ev...
Logstash
22,172,879
28
I'm using Logstash + Elasticsearch + Kibana to have an overview of my Tomcat log files. For each log entry I need to know the name of the file from which it came. I'd like to add it as a field. Is there a way to do it? I've googled a little and I've only found this SO question, but the answer is no longer up-to-date. S...
Hi I added a grok filter to do just this. I only wanted to have the filename not the path, but you can change this to your needs. filter { grok { match => ["path","%{GREEDYDATA}/%{GREEDYDATA:filename}\.log"] } }
Logstash
22,916,200
28
Well, after looking around quite a lot, I could not find a solution to my problem, as it "should" work, but obviously doesn't. I'm using on a Ubuntu 14.04 LTS machine Logstash 1.4.2-1-2-2c0f5a1, and I am receiving messages such as the following one: 2014-08-05 10:21:13,618 [17] INFO Class.Type - This is a log message ...
I have tested your date filter. it works on me! Here is my configuration input { stdin{} } filter { date { locale => "en" match => ["message", "YYYY-MM-dd;HH:mm:ss.SSS"] timezone => "Europe/Vienna" target => "@timestamp" add_field => { "debug" => "timestampMatched"} }...
Logstash
25,156,517
28
Recently our server was rebooted without correctly shutting down the Elastic Search / Kibana. After that reboot, both applications were running but no indices were getting created anymore. I checked logstash setup in debug mode and it is sending data to Elastic Search. now all my created windows report this error: Oops...
You have many corrupt translog files, which you need to delete. You can find it in data/{clustername}/nodes/0/indices/logstash-2015.04.21/4/translog and another one in data/{clustername}/nodes/0/indices/logstash-2015.03.16/1/translog. And maybe others, but this is what I can tell from the snippet you provided. Of cours...
Logstash
30,073,759
27
Is it possible to log actions of the logstash file plugin? (i.e. what files it tries to send, what errors happen, etc)
In new version stdout format changed stdout { codec => rubydebug }
Logstash
19,086,404
25
I'm trying to backfill some past Apache access log data with logstash, therefore I need the event @timestamp to be set to the date appearing in the log message. This is my current logstash configuration: input { tcp { type => "access_log" port => 9293 } } filter { grok { match => { "...
Ok, I found the problem, I was using the wrong syntax on the match operation: match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] NOT match => { "timestamp" => "dd/MMM/yyyy:HH:mm:ss Z" }
Logstash
20,312,416
25
The syntax for a grok pattern is %{SYNTAX:SEMANTIC}. How do i generate a list of all available SYNTAX keywords ? I know that I can use the grok debugger to discover patterns from text. But is there a list which i can scan through?
They are in GIT and included somewhere in the distribution. But it's probably just easiest to view it online: https://github.com/elasticsearch/logstash/blob/v1.4.0/patterns/grok-patterns
Logstash
23,523,790
24
I have a basic Logstash -> Elasticsearch setup, and it turns out the 'message' field is not required after the logstash filter done its job - storing this raw message field to elasticsearch is only adding unnecessary data to storage imo. Can I safely delete this field and would it cause any trouble to ES? advices or re...
No, it will not cause any trouble to ES. You can delete message field if it is redundant or unused. You can add this filter to end of the filters. mutate { remove_field => [ "message" ] }
Logstash
26,006,826
24
I'm doing "elastic search getting started" tutorial. Unfortunatelly this tutorial doesn't cover first step which is importing csv database into elasticsearch. I googled to find solution but it doesn't work unfortunatelly. Here is what I want to achieve and what I have: I have a file with data which I want to import (si...
Good job, you're almost there, you're only missing the document ID. You need to modify your elasticsearch output like this: elasticsearch { action => "index" hosts => ["127.0.0.1:9200"] index => "simpsons" document_type => "episode" document_id => "%{id}" <---- add this line workers ...
Logstash
43,701,016
24
I have a set of dockerized applications scattered across multiple servers and trying to setup production-level centralized logging with ELK. I'm ok with the ELK part itself, but I'm a little confused about how to forward the logs to my logstashes. I'm trying to use Filebeat, because of its loadbalance feature. I'd also...
Here's one way to forward docker logs to the ELK stack (requires docker >= 1.8 for the gelf log driver): Start a Logstash container with the gelf input plugin to reads from gelf and outputs to an Elasticsearch host (ES_HOST:port): docker run --rm -p 12201:12201/udp logstash \ logstash -e 'input { gelf { } } output...
Logstash
33,432,983
22
I used the following piece of code to create an index in logstash.conf output { stdout {codec => rubydebug} elasticsearch { host => "localhost" protocol => "http" index => "trial_indexer" } } To create another index i generally replace the index name with another in th...
You can use a pattern in your index name based on the value of one of your fields. Here we use the value of the type field in order to name the index: output { stdout {codec => rubydebug} elasticsearch { host => "localhost" protocol => "http" index => "%{type}_indexer" }...
Logstash
33,820,478
22
I am trying to find the different kinds of syntax I can give in regex type of query through kibana, but I was not able to find any information on this. I am running logstash and elasticsearch in the backend. Any answer or example will be helpful.
so any regular expressions are valid in grok as well. The regular expression library is Oniguruma. I took this from the logstash docs online. Also from [a Google Groups post]: Kibana is a web interface which stay in front of ElasticSearch: to understand the query syntax you have to know something more about Apache Luce...
Logstash
21,955,183
21
So, I'm building a full cloud solution using kubernetes and spring boot. My spring boot application is deployed to a container and logs directly on the console. As containers are ephemerals I'd like to send logs also to a remote logstash server, so that they can be processed and sent to elastic. Normally I would insta...
You can try to add logback.xml in resources folder : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration> <configuration scan="true"> <include resource="org/springframework/boot/logging/logback/base.xml"/> <appender name="logstash" class="net.logstash.logback.appender.LogstashTcpSocketAppender"> ...
Logstash
57,399,354
21
I am writing a filebeat configuration when I am matching if a line starts with a number like 03:32:33 ( a timestamp). I am currently doing it by- \d But its not getting recognised, is there anything else which I should do. I am not particularly good/ have experience with regex. Help will be appreciated.
The real problem is that filebeat does not support \d. Replace \d by [0-9] and your regular expression will work. I suggest you to give a look at the filebeat's Supported Patterns. Also, be sure you've used ^, it stands for the start of the string.
Logstash
37,531,205
20
For optimization purposes, I am trying to cut down my total field count. However before I am going to do that I want to get an idea of how many fields I actually have. There doesn't seem to be any Information in the _stats endpoint and I can't quite figure out how the migration tool does its field count calculation. Is...
To build a bit further upon what the other answer provided, you can get the mapping and then simply count the number of times the keyword type appears in the output, which gives the number of fields since each field needs a type: curl -s -XGET localhost:9200/index/_mapping?pretty | grep type | wc -l
Logstash
40,586,020
20
We have an existing search function that involves data across multiple tables in SQL Server. This causes a heavy load on our DB, so I'm trying to find a better way to search through this data (it doesn't change very often). I have been working with Logstash and Elasticsearch for about a week using an import containing ...
Converting from comment: You can overwrite a document by sending another document with the same ID... but that might be tricky with your previous data, since you'll get randomized IDs by default. You can set an ID using the output plugin's document_id field, but it takes a literal string, not a field name. To use a fie...
Logstash
21,716,002
19
I am using logstash to feed logs into ElasticSearch. I am configuring logstash output as: input { file { path => "/tmp/foo.log" codec => plain { format => "%{message}" } } } output { elasticsearch { #host => ...
You will need a mapping to store data in Elasticsearch and to search on it - that's how ES knows how to index and search those content types. You can either let logstash create it dynamically or you can prevent it from doing so and instead create it manually. Keep in mind you cannot change existing mappings (although y...
Logstash
24,924,248
19
I have JSON file that I'm sending to ES through logstash. I would like to remove 1 field ( It's deep field ) in the JSON - ONLY if the value is NULL. Part of the JSON is: "input": { "startDate": "2015-05-27", "numberOfGuests": 1, "fileName": "null", "existingSessionId": "XXXXXXXXXXXXX",...
Nested fields aren't referred with [name.subfield] but [field][subfield]. This should work for you: if [input][radius] == "null" { mutate { remove_field => [ "[input][radius]" ] } } Note that if there is no "input" field, the [input][radius] reference will create an empty "input" dictionary. To avoid that you ...
Logstash
30,369,148
19
Is the Logstash configuration reloaded every time the agent is restarted? It doesn't seem to pick up my changes immediately (e.g. changed type value) I'm running it with an embedded elasticsearch v.0.90.7 on Windows 7 and Kibana 3. Thank you very much! Regards, Paul
Hot Reload is not yet supported. There is a Issue. The logstash configuration is loaded at startup, so, if you kill your process (to restart it later), there is no reason why it does not work.
Logstash
20,695,665
18
I want to send logs from a Java app to ElasticSearch, and the conventional approach seems to be to set up Logstash on the server running the app, and have logstash parse the log files (with regex...!) and load them into ElasticSearch. Is there a reason it's done this way, rather than just setting up log4J (or logback) ...
If you really want to go down that path, the idea would be to use something like an Elasticsearch appender (or this one or this other one) which would ship your logs directly to your ES cluster. However, I'd advise against it for the same reasons mentioned by @Vineeth Mohan. You'd also need to ask yourself a couple que...
Logstash
32,302,421
18
I am logging to logstash,in json format, my logs have the following fields, each field is a string and the atts field is a stringified json (note: atts sub fields are different each time) here is an example: {"name":"bob","last":"builder", "atts":"{\"a\":111, \"b\":222}"} I would like to parse it to something like this...
thanks to @Alcanzar here is what I did input { stdin { } } filter { json { source => "message" target => "message" } json { source => "[message][atts]" target => "[message][atts]" } } output { stdout { codec => rubydebug }}
Logstash
43,232,683
18
I am using logstash jdbc to keep the things syncd between mysql and elasticsearch. Its working fine for one table. But now I want to do it for multiple tables. Do I need to open multiple in terminal logstash agent -f /Users/logstash/logstash-jdbc.conf each with a select query or do we have a better way of doing it s...
You can definitely have a single config with multiple jdbc input and then parametrize the index and document_type in your elasticsearch output depending on which table the event is coming from. input { jdbc { jdbc_driver_library => "/Users/logstash/mysql-connector-java-5.1.39-bin.jar" jdbc_driver_class => "co...
Logstash
37,613,611
17
Can anyone show me what an if statement with a regex looks like in logstash? My attempts: if [fieldname] =~ /^[0-9]*$/ if [fieldname] =~ "^[0-9]*$" Neither of which work. What I intend to do is to check if the "fieldname" contains an integer
To combine the other answers into a cohesive answer. Your first format looks correct, but your regex is not doing what you want. /^[0-9]*$/ matches: ^: the beginning of the line [0-9]*: any digit 0 or more times $: the end of the line So your regex captures lines that are exclusively made up of digits. To match on the ...
Logstash
42,341,778
17
I need to customize log messages to a JSON format in my Rails app. To illustrate, currently the log messages my app produces look like this: I, [2015-04-24T11:52:06.612993 #90159] INFO -- : Started GET "/time_entries" for ::1 at 2015-04-24 11:52:06 -0400 As a result, log messages like the line above get written to m...
You can configure rails to specify your own log formatter: config.log_formatter defines the formatter of the Rails logger. This option defaults to an instance of ActiveSupport::Logger::SimpleFormatter for all modes except production, where it defaults to Logger::Formatter. You can provide your own class to output the...
Logstash
29,855,097
16
I wanted to make a copy of a nested field in a Logstash filter but I can't figure out the correct syntax. Here is what I try: incorrect syntax: mutate { add_field => { "received_from" => %{beat.hostname} } } beat.hostname is not replaced mutate { add_field => { "received_from" => "%{beat.hostname}" } } beat.h...
EDIT: Since you didn't show your input message I worked off your output. In your output the field you are trying to copy into already exists, which is why you need to use replace. If it does not exist, you do in deed need to use add_field. I updated my answer for both cases. EDIT 2: I realised that your problem might...
Logstash
39,124,087
16
I'm trying to download jdbc connector, but I cannot find mac os from the selection options from the link below: https://dev.mysql.com/downloads/connector/j/ Where can I download mysql connector for mac os? Or is it the case that jdbc connector is already installed for mac os? I'm trying to using logstash to transfer my...
MySQL Connector/J is a Java library, and it is a pure Java driver, so it is platform independent. The various installers offered on the download page are just to simplify installation (although generally, installing Java libraries using an installer makes very little sense to me). For MacOS, you can use 'platform indep...
Logstash
53,312,893
16
Is it possible to use kibana front-end along with a mongodb back-end without using elastic search? I'm using logstash to parse logs and store in mongodb and want to use kibana to display data? If not, are there any alternatives to implement kibana+mongodb?
I'm afraid that Kibana is specifically designed to use the Elasticsearch API. While they do both provide JSON responses, they don't return compatible data structures and even if they did, Mongo would not provide the same features (facets/filters) that Kibana makes heavy use of. You could probably index your MongoDB dat...
Logstash
24,248,609
15
I have data in an AWS RDS, and I would like to pipe it over to an AWS ES instance, preferably updating once an hour, or similar. On my local machine, with a local mysql database and Elasticsearch database, it was easy to set this up using Logstash. Is there a "native" AWS way to do the same thing? Or do I need to set u...
You can achieve the same thing with your local Logstash, simply point your jdbc input to your RDS database and the elasticsearch output to your AWS ES instance. If you need to run this regularly, then yes, you'd need to setup a small instance to run Logstash on it. A more "native" AWS solution to achieve the same thin...
Logstash
43,688,180
15
I'm trying to sync data between MySQL and Elasticsearch with Logstash. I set multiple jdbc inputs and multiple outputs to different elasticsearch indexes ... and something I am doing wrong because everything is going to the else block. Here is my config: input { jdbc { jdbc_connection_string => "jdbc:mysq...
Solution found! I used tags instead of type input { jdbc { ... tags => "table1" ... } jdbc { ... tags => "table2" ... } } output { if "table1" in [tags] { } https://discuss.elastic.co/t/solved-multiple-logstash-config-file/51692/10
Logstash
44,293,952
15
I am trying to connect Logstash with Elasticsearch but cannot get it working. Here is my logstash conf: input { stdin { type => "stdin-type" } file { type => "syslog-ng" # Wildcards work, here :) path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ] } } output { stdout { } ...
First, I suggest matching your "type" attributes up. In your input you have 2 different types, and in your output you have a type that doesn't exists in any of your inputs. For testing, change your output to: output { stdout { } elasticsearch{ type => "stdin-type" embedded => false host => "192.168.0.23" ...
Logstash
17,046,047
14
Im trying to parse my apache2 error log and im having a bit of trouble.. It doesnt seem to be matching the filter. Im pretty sure the timestamp piece is wrong, but im not sure, and i cant really find any documentation to figure it out. Also, is there a way to get what is in fields.errmsg to me @message? Log [Wed Jun 26...
Ahoy! I know I'm a little late to the party, but here it goes! I created a /etc/logstash/patterns.d/ directory on the system and thew a file named apache-error in it containing: APACHE_ERROR_TIME %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR} APACHE_ERROR_LOG \[%{APACHE_ERROR_TIME:timestamp}\] \[%{LOGLEVEL:loglevel}\] (?:...
Logstash
17,331,593
14
I'm still a bit confused after reading documentation provided by logstash. I'm planning on writing an Android app, and I want to log the activity of the app. Logs will be sent over the network. is logstash not the right solution? because it needs to have an "agent" installed on systems that produces log. I want a syste...
Logstash forwarder isn't currently available for android/ios unfortunately, nor could I find any existing solution for it from the community. (I asked the same question here but was voted off-topic because it was deemed asking for tool/library suggestions). Your best bet unfortunately is either to write one yourself (w...
Logstash
20,099,362
14
I have a drupal watchdog syslog file that I want to parse into essentially two nested fields, the syslog part and the message part so that I get this result syslogpart: { timestamp: "", host: "", ... }, messagepart:{ parsedfield1: "", parsedfield2: "", ... } I tried making a custom pattern that looks like ...
Actually, you can do something like that in your pattern config %{WORD:[drupal][program]} It will create the json object like drupal:{ program: "..." }
Logstash
28,748,674
14
I'm having trouble with ElasticSearch, how can I change id to another field in log file ?
In the elasticsearch output you can set the document_id for the event you are shipping. This will end up being the _id in elasticsearch. You can use all sort of parameters / field references / ... that are available in logstash config. Like so: elasticsearch { host => yourEsHost cluster => "yourCluster" in...
Logstash
30,391,898
14
recently I started working on ElasticSearch (ES) implementation into legacy e-commerce app written in PHP using MySQL. I am completely new to all this stuff and reading the docs is fine, yet I really need somebody with experience to advise me. From the ES documentation I was able to setup a new cluster and I also foun...
That's a great start! I would definitely flatten it all out (i.e. denormalize) and come up with product documents that look like the one below. That way you get rid of the N:M relationship between products and flags by simply creating a flags array for each product. It will thus be easier to query those flags. { "id...
Logstash
36,915,428
14
I get above Mapper Parsing Error on Elasticsearch when indexing log from filebeat. I tried both Filebeat -> Elasticserach and Filebeat -> Logstash -> Elasticsearch approach. I have followed their own documentations, I installed filebeat template as per instructed and verified from Loading the Index Template in Elastics...
You cannot use "type": "keyword" with ES 2.3.3 since that's a new data type in ES 5 (currently in alpha3) You need to replace all those occurrences with "type": "string", "index": "not_analyzed" You need to use filebeat.template-es2x.json instead.
Logstash
37,599,410
14
I am using ELK stack for centralised logging from my Django server. My ELK stack is on a remote server and logstash.conf looks like this: input { tcp { port => 5959 codec => json } } output { elasticsearch { hosts => ["xx.xx.xx.xx:9200"] } } Both services elasticsearch and logstash are working (c...
Looking at the configuration, logger "django.request" is set to level "DEBUG" and the handler "logstash" is set to level "INFO". My guess is that the handler will not process DEBUG messages. I'm not sure though. Set the same level for the logger and the handler to test that it works. What level to use depends on what y...
Logstash
45,117,988
14
I am trying add custom field into logstash appender in logback-spring.xml like that: <?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="stash" class="net.logstash.logback.appender.LogstashSocketAppender"> <host>xx.xx.xx.xx</host> <port>xxxxx</port> <encoder class="net.logstas...
You're using an UDP appender, and it does not have an encoder. You should use TCP Appender (LogstashTcpSocketAppender instead of LogstashSocketAppender): <appender name="stash" class="net.logstash.logback.appender.LogstashTcpSocketAppender"> <destination>xx.xx.xx.xx:xxxxx</destination> <encoder class="net.logst...
Logstash
53,558,553
14
I've tried updating the number of replicas as follows, according to the documentation curl -XPUT 'localhost:9200/_settings' -d ' { "index" : { "number_of_replicas" : 4 } }' This correctly changes the replica count for existing nodes. However, when logstash creates a new index the following day, number_of_replicas is s...
Yes, you can use index templates. Index templates are a great way to set default settings (including mappings) for new indices created in a cluster. Index Templates Index templates allow to define templates that will automatically be applied to new indices created. The templates include both settings and mappings,...
Logstash
24,553,718
13
So, I have a web platform that prints a JSON file per request containing some log data about that request. I can configure several rules about when should it log stuff, only at certain levels, etc... Now, I've been toying with the Logstash + Elasticsearch + Kibana3 stack, and I'd love to find a way to see those logs in...
Logstash is a very good tool for processing dynamic files. Here is the way to import your json file into elasticsearch using logstash: configuration file: input { file { path => ["/path/to/json/file"] start_position => "beginning" sincedb_path => "/dev/null" exclude => "*.gz" ...
Logstash
25,977,423
13
We have data that is coming from external sources as below in csv file: orderid,OrderDate,BusinessMinute,Quantity,Price 31874,01-01-2013,00:06,2,17.9 The data has date in one column and time in another column - I need to generate a time-stamp by combining those two columns together. I am using csv filter to read the a...
Use a mutate filter to combine the OrderDate and BusinessMinute fields into a single (temporary) field, then use the date filter and have it delete the field if it's successful. filter { mutate { add_field => { "timestamp" => "%{OrderDate} %{BusinessMinute}" } } date { match => ["timestamp", ".....
Logstash
28,879,131
13
We are using the ELK for log aggregation. Is it possible to search for events that occured during a particular time range. Lets say I want to see all exceptions that occurred between 10am and 11am in last month. Is it possible to extract the time part from @timestamp and do a range search on that somehow (similiar to d...
Thanks to Magnus who pointed me to looking at scripted fields. Take a look at: https://www.elastic.co/blog/kibana-4-beta-3-now-more-filtery or https://www.elastic.co/guide/en/elasticsearch/reference/1.3/search-request-script-fields.html Unfortunately you can not use these scripted fields in queries but only in visuali...
Logstash
30,396,242
13
I have tab separated data which I want to input into logstash. Here is my configuration file: input { file { path => "/*.csv" type => "testSet" start_position => "beginning" } } filter { csv { separator => "\t" } } output { stdout { codec => rubydebug } ...
Instead of using "\t" as the seperator, input an actual tab. like this: filter { csv { separator => " " } }
Logstash
30,915,011
13
I have a Logstash instance running as a service that reads from Redis and outputs to Elasticsearch. I just noticed there was nothing new in Elasticsearch for the last few days, but the Redis lists were increasing. Logstash log was filled with 2 errors repeated for thousands of lines: :message=>"Got error to send bulk o...
According to your log message: {"error":"IllegalArgumentException[Malformed action/metadata line [107], expected a simple value for field [_type] but found [START_ARRAY]]","status":500}, It seems you're trying to index a document with a type field that's an array instead of a string. I can't help you without more of ...
Logstash
32,354,862
13
I am parsing a set of data into an ELK stack for some non-tech folks to view. As part of this, I want to remove all fields except a specific known subset of fields from the events before sending into ElasticSearch. I can explicitly specify each field to drop in a mutate filter like so: filter { mutate { rem...
Prune whitelist should be what you're looking for. For more specific control, dropping to the ruby filter is probably the next step.
Logstash
33,399,196
13
So, let's assume that I have a portion of a log line that looks something like this: GET /restAPI/callMethod1/8675309 The GET matches a http method, and get's extracted, the remainder matches a URI, and also gets extracted. Now in the logstash config let's assume that I wanted to do something like this... if [METHOD]...
You can achieve it simply by using the =~ (regexp) operator like this (see conditionals): if [METHOD] == "GET" { if [URI] =~ /restAPI\/callMethod1/ { ...
Logstash
39,022,920
13
I am using Logstash-5.6.5 (in Windows) running in a standalone system (no cloud or cluster). Planning to watch some log files and post it to locally run elasticsearch. But when checked the Logstash's memory usage, without a configuration to watch any file it is showing around 600MB memory usage. When I add input file p...
After researching for couple of days below is my answer to my question. Below are the ways we can optimize Logstash memory: Logstash memory usage is primarily getting accumulated by heap size. This can be effectively controlled by setting the heap memory size in the environment variable LS_JAVA_OPTS as below, before l...
Logstash
48,576,637
13
I want to sync my MongoDB data to ElasticSearch, I read a lot of posts talking about elasticsearch river plugin and mongo connector, but all of them are deprecated for mongo 4 and elasticsearch 7! As logstash is a proprietary software I would like to use it to sync both... Anyone knows how it's possible to do it?
You may sync MongoDB and Elasticsearch with Logstash; syncing is, in fact, one of the major applications of Logstash. After installing Logstash, all that you need to do is specify a pipeline for your use case: one or more input sources (MongoDB in your case) and one or more output sinks (Elasticsearch in your case), pu...
Logstash
56,628,675
13
I am trying out the ELK to visualise my log file. I have tried different setups: Logstash file input plugin https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html Logstash Beats input plugin https://www.elastic.co/guide/en/logstash/current/plugins-inputs-beats.html with Filebeat Logstash output http...
1) To use logstash file input you need a logstash instance running on the machine from where you want to collect the logs, if the logs are on the same machine that you are already running logstash this is not a problem, but if the logs are on remote machines, a logstash instance is not always recommended because it nee...
Logstash
58,585,855
13
I've got log lines in the following format and want to extract fields: [field1: content1] [field2: content2] [field3: content3] ... I neither know the field names, nor the number of fields. I tried it with backreferences and the sprintf format but got no results: match => [ "message", "(?:\[(\w+): %{DATA:\k<-1>}\])+" ...
Logstash Ruby Plugin can help you. :) Here is the configuration: input { stdin {} } filter { ruby { code => " fieldArray = event['message'].split('] [') for field in fieldArray field = field.delete '[' field = field.delete ']' res...
Logstash
24,605,331
12
I am just getting started with Logstash and wondering whether there is a way to specify block comments in logstash config file? It will be very useful as I am testing with long grok patterns which span multiple lines.
Currently there is no block comments available . We have to go for single line comment only by using # at the start of line which you need to comment out. Also comments can be used anywhere in the line # this is a comment input { # comments can appear at the end of a line, too # ... }
Logstash
31,249,588
12
I am working on a solution for centralized log file aggregation from our CentOs 6.x servers. After installing Elasticsearch/Logstash/Kibana (ELK) stack I came across an Rsyslog omelasticsearch plugin which can send messages from Rsyslog to Elasticsearch in logstash format and started asking myself why I need Logstash. ...
I would use Logstash in the middle if there's something I need from it that rsyslog doesn't have. For example, getting GeoIP from an IP address. If, on the other hand, I would need to get syslog or file contents indexed in Elasticsearch, I'd use rsyslog directly. It can do buffering (disk+memory), filtering, you can ch...
Logstash
32,124,984
12
I have a logfile which looks like this ( simplified) Logline sample MyLine data={"firstname":"bob","lastname":"the builder"} I'd like to extract the json contained in data and create two fields, one for firstname, one for last. However, the ouput i get is this: {"message":"Line data={\"firstname\":\"bob\",\"lastname\"...
After your json filter add another one called mutate in order to add the two fields that you would take from the parsedJson field. filter { ... json { ... } mutate { add_field => { "firstname" => "%{[parsedJson][firstname]}" "lastname" => "%{[parsedJson][lastname]}" } } } For your sa...
Logstash
33,937,936
12
I believe it is simple question but I still do not get it from Docker-compose documentations. What is the difference between links and external_links? I like external_links as I want to have core docker-compose and I want to extend it without overriding the core links. What exactly I have, I am trying to setup logstas...
Use links when you want to link together containers within the same docker-compose.yml. All you need to do is set the link to the service name. Like this: --- elasticsearch: image: elasticsearch:latest command: elasticsearch -Des.network.host=0.0.0.0 ports: - "9200:9200" logstash: image: logstash:latest ...
Logstash
35,154,441
12