Merging visualization with timestamp - kibana

I have the bar chart that looks exactly the way I want.
https://search-test01-uwyuzluuwezhhbeusk3od5mfti.us-east-1.es.amazonaws.com/_plugin/kibana/app/kibana#/visualize/
(Visualization name : myvs1)
It has IP address as X-axis and event-names count as Y axis. But how do I know the date on which the IP address was logged?
Is it possible to easily integrate visualizations to Timelion chart?

You can add the date by following below mentioned steps:-
Open your already saved visualization.
Under buckets, click on Add Sub-Buckets.
Select bucket type as X-Axis.
Mention sub-aggregation as Date Histogram.
Specify field as #timestamp or any other custom field which contains date/time information.
Your visualization will now showcase the date/time.

Related

How to provide filter tab in timelion charts?

I am trying out some timelion visualizations in Kibana. In it I am not sure how to provide filter tab for the data.
For example, yearly country population data and filter tab to filter it based on zone and state.
Usually a timelion expression is just like ".es()" and some functions which can be appended to it like
.es(*).bars().label("Population")
I don't want to specify filter under ".es(q=???)" as this will make the filter static and the user won't be able to use filtering directly. ( In this case, every time user has to go to edit timelion window and edit filter there.)
you can specify a lucene query string as the q argument to .es() as in
.es(q=field:value)
That query string would only affect this time series and not interfere with the rest of your dashboard.

How to list unique values of a particular field in Kibana

I am having a field named rpc in my elasticsearch database and I am displaying it using Kibana. When I search in search bar of kibana like:
rpc:*
It display all the values of rpc field but I want to have only those value to be displayed which are unique.
I have been playing around with Kibana4 since a couple of weeks now. I find it intuitive and simple and the experience has been great till now. Following your question, I tried getting unique results via a Data Table visualization. Why? Because I personally find it easier to understand. Following are the steps:
1. Get unique count
Create the visualization (Visualize -> Data Table). First lets get
the count of how many unique entries we have for a particular field
(We will use this in the later part for verification). I'm using
clientip.raw but as I see, it will work just fine with any friendly
field name too.
2. Set the aggregation right
Set you aggregation back to count and have a Split Rows as follows. Not doing this will give you count 1 for each field value (since it is looking for unique counts) when you populate the table. Noteworthy part is setting the Top field to 0. Because Kibana won't let you enter anything else than a digit (Obviously!). This was the tricky part. Hit Apply and you'll get the results. Unique field values and the count of each of them.
3. Verification:
Going to the last page of the table, we see there are exactly 543 results. This is how I know it works.
What Next?
You save this visualization and add it to a Dashboard. There you can always check the request, query, response and other stats.
Just an addition to the above mathakoot answer.
For the user of newer version (which do not allow bucket size of 0 anymore) just set a value greater than the maximum number of result
And report the value in the Options>Per Page field
I am using Kibana 6 so the UI looks a bit different than the older answers here.
Here is what worked for me
Create a visualization from your query, I used a line graph type (don't think it matters)
Under Data, set metrics aggregation = "Unique Count" and set field to your field.
Set x-axis aggregation = "Terms" and set field to your field.
Set Size > your number of records
Under Metrics and Axes, disable drawing of the graph, circles, and labels (this really helps the UI not lag)
Run query and then click "Inspect" and download CSV
Data
Metrics & Axes
I wanted to achieve something similar but I'm stuck with Kibana 3.1.
I simply added a panel of type "TERMS" and configured its Field = User-agent and left everything else on default values. This gave me a nice bar chart with one bar for each User-agent.

Generate heatmap in Kibana?

Does anyone know of a way to generate heatmaps in Kibana?
What I'm looking for is something similar to the clusters in bettermap, but continuous (and color-coded).
The only prerequisite is to have a geoip.location field.
If you're using an log which provide the requester origin IP you can easily get the Longitude, Latitude and then convert those values to the required geoip.coordinates field, and then the location
In kibana 4 beta:
open the Visualize tab
select tile map object
in the metrics value select the desired criteria from the drop down list, e.g. unique count
select the relevant field, e.g. hostip
in the buckets select Geo Coordinates
in the field select geoip.location
select the require percision (this might be important if you don't have a lot of data)
select the view option, you can toggle between change in color or size of circle
BTW, if you're using logstash to send the request to elasticsearch you can use the dns filter to reverse IP to coordinates
logstash dns filter
Heatmap support for Kibana 4 is on the way - and it's looking good.
Apparently the delay is that is has to be rewritten slightly to use SVG rather than it's current approach.
https://github.com/elastic/kibana/issues/1265
In Kibana 4, the index field has to be explicity defined as a geo_ip type in your mapping. Kibana 3 was able to correctly interpret floats etc. as coordinates, but as of now 4 does not. Once you change it you will have to reindex your data, and it should be all set.

SSRS Chart Blank with DateTimes

I am working with SSRS and having trouble creating a graphical chart to display data. My dataset is very simple, as it only has one column which is a datetime field (known as CreatedOn).
My SQL query is:
SELECT [CreatedOn]
FROM [Incident]
WHERE CreatedOn > DATEADD(m,-11, DATEADD(
month, DATEDIFF(month, 0,CURRENT_TIMESTAMP), 0))
My goal is to have the query results show up in a chart and have them grouped by year and by month, as well as sorted. For example, I should be able to see that 40 incidents were created in February 2005. Those 40 incidents would be represented graphically as a single bar (it is a bar graph) with the number 40 on top (or somewhere).
My issue is that either my chart shows up completely blank, or the report fails to run. When it fails to run, the error I receive is:
the value expression for field 'CreatedOn' contains an error: conversion from string 'CreatedOn' to type 'Date' is not valid.
I have tried using SSRS expressions on the CreatedOn field, such as CDate() and FormateDateTime(). That does get the report to run, but the chart shows up blank. I would not think that the field should have to be formatted or converted in SSRS since it is already a datetime field at the database level. I have tried about 10 different combinations of groupings and sorts, but my chart always shows up blank. I have even used CDate() and so forth in the grouping and sort expressions which are a part of the chart.
How can I get my bar chart to work (a.k.a. show datetimes, grouped and sorted)?
I am going to go off the assumption:
You have more data being pulled than just the ‘CreatedOn’ field.
a. Because if you don't it will be difficult to create a chart as you have nothing else to compare it too.
If this is an accurate assumption here is an example of how to create a chart and have the data formatted by dates.
When designing a chart you need to take a lot into consideration. First I like to ensure that I have as little null data as possible. This causes charts to act wonky (at least from my experience).
Second is how the data will be represented.
We have several things to consider when we think about charts and groups.
There are Category groups, Series groups, and then the Values.
According to Microsoft: charts have a direct similarity to Matrix’s. They act the same way:
The Column groups of a Matrix are similar to that of the Category Groups in a chart.
The Row groups of a Matrix are similar to that of the Series Groups in a chart.
The Data area of a Matrix is similar to that of the Values Groups in a chart.
Setting Up the chart:
If we want the number of Incidents sorted by Year and then Month it might look something like this:
Year by Category (You can use your group by Expression here) =Year(Fields!CreatedOn.Value)
Incidents will be in the Values section =Count(Fields!Incidents.Value)
Once you have that working and showing data I would then start adding in the data for the month. Again thinking about how you want to have the data displayed. You could then add a second Grouping on the category under the other one with your month function.
Another Useful link on charts (I know this is a little older but it’s details are still relevant)
*Side Note: When dealing with dates it can be a little tricky especially if SSRS is not recognizing something as a date. Here is a useful link that I have used when dealing with dates.
Dates
I hope this helped!
The issue was that the CreatedOn date field was not being defined correctly.
My data source was defined using an expression which depended upon parameters, using the expression: ="Data Source=sql01;" & "Initial Catalog=" & Parameters!ParentID.Value. Because the dataset must be defined at the runtime of the report, I was not able to refresh fields in the dataset using the "Refresh Fields" button.
I thought that I could work around this by defining the CreatedOn field manually. On the first attempt, SSRS threw an error at runtime claiming that I was trying to convert a string to a date, which basically meant that it perceived the CreatedOn field as defined within the dataset as a string. So I then tried to use the CDate() expression in the definition of the field, but that left me with a completely blank graph.
The solution was to:
Delete all of the fields I already had defined within the dataset
Temporarily hard-code my data source to use a database (Data Source=sql01;Initial Catalog=MyDatabaseName)
Click the "Refresh Fields" button within the dataset
Go back at set the data source to the original data source I wanted which depended upon parameters.

MS Chart Control

I am using MS Chart control in asp.net 4.0 application.In that dates are being displayed on Xaxis and count is displayed on Y axis.
If there no data for a specific date its displaying minimum date like "30-12-1899" . Let me know how to display information on the graph without these minimum dae values.
Below is the chart link which I am using in my application http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&displaylang=en
Thanks,
Hima
My guess is you are adding points with zero as the X value. This gets translated to DateTime.MinValue which will give you the strange date. Try using double.NaN or just don't add points if there is no data.
Are you able to post the code you are using to create your chart? That will help troubleshoot your problem.

Resources