Kibana3 - Graph to plot amount of bytes per minute - kibana

I have apache logs with size of each request and the time , I need to plot graph on amount of data transfered per unit time.
A sample document looks like below
{
"#timestamp" : "2015-01-01T00:00:00",
"bytes" : 20
}
For each minute , I want to take sum of the bytes field and plot that over a graph in Kibana 3. Can anybody help me on this?

This can be done by editing the panel settings,as shown in the figure below:
"Values" dropdown: Select the value to be "total" from this.
Values Field : The field which is to be analysed. Here in your case it is "values"
"Time Field" : the timefield in your data,ie "#timestamp"
"interval" : set as "1m" here.

You should be able to do this using a histogram panel.
Under values, set 'chart value' to 'total' and use bytes as the value field
Check that 'time field' is #timestamp
Untick auto-interval and set the interval to be '1m'

Related

get custom value from point series data

I am adding data to scatter series like below , how do we receive the custom parameter value I add here
series.add({
x: 0,
y: 22,
color: ColorRGBA(255, 0, 0),
size: 10,
rotation: 45,
value: "custom message",
});
From the above series how do I extract the value "custom message" .. basically is there anyway to get it ? so I can to use it in table formatter like below .
series.setCursorResultTableFormatter((builder, series, xValue, yValue,value) => {
return builder.addRow(value).addRow(series.getValue());
});
Also another doubt is can we change shape of series dynamically like we change color and size ?
With v.3.1 this kind of logic is not supplied out of the box.
To implement it you'd need to add some kind of custom logic which finds your custom data based on the X and Y information.
In next release, v.3.2 we'll add an extra parameter to cursor result table formatters, so you can use it like follows:
series.setCursorResultTableFormatter((builder, series, x, y, dataPoint) => {
// `dataPoint` has all same information as user supplied, size, rotation, value or anything.
return builder.addRow(x).addRow(y).addRow(dataPoint.value);
});
Please note that these custom properties (size, rotation, value, etc.) will only be included when cursor interpolation is disabled.
At this time v.3.2 is scheduled for late September, but this could change.
2nd question about changing shape of point series, we currently don't have active plans to change this, but when there is enough motivation it will be improved on.

Kibana: Pie Chart slices based on beginning value of field only

I am trying to visualize field data but based on the first 3 characters within the string. Say the field contains "+44123456", I want the pie chart to visualize based on "+44" only.
Please assist me in achieving this with advanced JSON field ?
You can do it via using the "Advanced JSON" input field :
Try following script :
{
"script": "( _value.indexOf(' ') > 0 ? _value.substring(_value.lastIndexOf(' ')) : _value )"
}

Transform report with distribution by months

I have the following ALV report generated from the RFKSLD00 program:
I need to generate a report based on the above report like this one (as part of my work):
Any ideas how to do this? I am not asking for a solution but some steps on how to achieve this.
Each line of the original report is one line of your report, you need just to adjust the sums for local currency, i.e. multiply all values by local currency rate. The yellow totals lines shouldn't confuse you, they are generated by grid, not by report.
The only thing that is missing in original report is debit and credit of balance carryforward, I suppose in the original you have already reconciliated value. To get separate values for it you need inspecting the code.
The initial step would be to declare final structure and table based on it:
TYPES: BEGIN OF ty_report,
rec_acc TYPE skont,
vendor TYPE lifnr,
...
jan_deb TYPE wrbtr,
jan_cred TYPE wrbtr,
febr_deb TYPE wrbtr,
febr_cred TYPE wrbtr,
...
acc_bal_deb TYPE wrbtr,
acc_bal_cred TYPE wrbtr,
END OF ty_report,
tt_report TYPE TABLE OF ty_report.
DATA: lt_report TYPE tt_report.
Then you only need looping original report internal table and fill your final structure, not missing currency conversion:
select single * from tcurr
into #DATA(tcurr)
where fcurr = 'EUR'
and tcurr = 'AUD'. "<- your local currency
DATA(lv_ukurs) = tcurr-ukurs.
LOOP AT orig_table INTO DATA(orig_line).
APPEND INITIAL LINE INTO lt_report ASSIGNING FIELD-SYMBOL(<fs_rep>).
MOVE-CORRESPONDING orig_line TO <fs_rep>.
CASE orig_line-monat. "<- your period
WHEN '01'.
<fs_rep>-jan_deb = orig_line-debit.
<fs_rep>-jan_cred = orig_line-credit.
WHEN '02'.
<fs_rep>-febr_deb = orig_line-debit.
<fs_rep>-febr_cred = orig_line-credit.
...
ENDCASE.
DO 30 TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_rep> TO FIELD-SYMBOL(<field>).
CHECK sy-subrc = 0.
DESCRIBE FIELD <field> TYPE DATA(TYP).
CHECK TYP = 'P'.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
DATE = sy-datum
FOREIGN_CURRENCY = 'EUR'
LOCAL_CURRENCY = 'AUD'
FOREIGN_AMOUNT = <field>
TYPE_OF_RATE = 'M'
IMPORTING
EXCHANGE_RATE = lv_ukurs
LOCAL_AMOUNT = <field>.
ENDDO.
ENDLOOP.
I recommend to name all components of your final structure ty_report the same as in original as much as possible. Thus you can maximally utilize MOVE-CORRESPONDING and avoid manual coding.
This is just quick shot and I may be missing some details and errors.

dojox.grid.EnhancedGrid how do i set a noDataMessage?

I'm trying to set a noDataMessage into a dojox.grid.EnhancedGrid, the grid works fine, when the store get data it show it's row with no problem, but I need that when the store gets no data the grid would show me a personalized message. I set the noDataMessage property which is a string, but nothing happened when has no data.
How can I trigger the event when no data in the store?
I get my data through a SQL query to a database and the answer is JSON serialized data.
here's the code of my grid.
intersGrid = new dojox.grid.EnhancedGrid({
// plugins: {dnd: true},viewInterconsulta
id :"intersGrid",
store: interfiltStore,
structure: intersLayout,
noDataMessage:"<span class=\"dojoxGridNoData\">No hay Datos</span>",
loadingMessage:'Cargando datos. Por favor espere.',
//noDataMessage: 'No existen pacientes esta agenda.',
errorMessage:'No existen datos para esta busqueda.'
}, "intersDiv");
solved.
What you have to do is.
if you get an empty store then set them like these:
$filas = "{ identifier: 'ID', items[]}";
**json_encode($filas)."}";
and then dojo shows the noDataMessage
In my case, I only showed 25 rows and then requested with help of offset & count another 25 when scrolling down the list. In this case, I needed "numRows" - which is the total amount of rows, leaving out offset & count. The "numRows" was set to 0 if no rows where found. But if it was given, the noDataMessage was not shown (btw: An "identifier" is not required).
Also there is a syntax error in your json, add some ":" after "items".
This is the JSON for the store, which shows the noDataMessage of a dojox datagrid:
{"items":[]}
This will not show it:
{"items":[],"numRows":"0"}
Using Dojo 1.6.1, a dojox.grid.DataGrid with a dojox.data.QueryReadStore

How to format timevalue to HH:MM:SS in datalabel

So i have a bar graph in crystal reports. On this graph i have a data label attached to each of the graphs that displays the value of the graph in seconds, which appears like so:
What i would like to do is format this data-label into a time formatting. So for each bar in the graph it would have the data-label appear in the following format:
HH:MM:SS.
i am able to get the time formatting to appear using the following formula:
local NumberVar Sec;
local NumberVar ss;
local NumberVar mm;
local NumberVar hh;
local StringVar SSS;
local StringVar MMM;
Sec := Sum ({GetAlarmSummaryDataSet2Response/GetAlarmSummaryDataSet2Result/Items/AlarmSummaryItem2.StopTime}, {GetAlarmSummaryDataSet2Response/GetAlarmSummaryDataSet2Result/Items/AlarmSummaryItem2.Section}) ;
hh := Int (Sec/3600);
mm :=Int ((Sec/60)- (60* Int(Sec/3600 )));
If mm<10 then MMM := "0" & ToText (mm,0);
If mm>9 Then MMM := ToText(mm,0) ;
ss :=Sec-(3600 * hh ) - (60 * mm ) ;
If ss<10 then SSS := "0" & ToText (ss,0);
If ss>9 Then SSS := ToText(ss,0) ;
ToText ( hh,0) & ":" & MMM & ":" & SSS
But what i am unsure of is how to implement this formula onto a data label.
Any help or suggestions are greatly appreciated.
Thank you
You can choose to display the group name, and you can display and format the summarized value calculated by the chart, but you can't provide a custom formula. It just isn't possible using the chart library in CR XI.
My eventual workaround for this problem:
Modify the value formula to eliminate the aggregate function. (This is necessary because Crystal won't allow an aggregate function in a group name field -- see #2.)
For the group name, specify a formula with the text you want to display in the riser. Include both the label and the formatted value, separated by Chr(13) & Chr(10) to place them on separate lines.
Configure the riser to display the label, not the value.
To apply this to your problem you'd need to make these changes:
Eliminate the aggregate function. Of course I don't know if this will be possible using your setup. Perhaps if you're using a DBMS you could use a SQL command or a stored procedure to calculate the sum before the data reaches Crystal.
Print the label and value together, either on the riser or the X-axis.
If that's not good enough for your application, you might consider CRChart, a commercial replacement which tries to address the sometimes-crippling limitations of Crystal's chart library. (I thought it was too pricey.) I think the #APPEND_DATATEXT macro would let you place a custom value on a riser, but you'd still need to move the summary to the server.

Resources