I believe I've done everything right when creating my graphite DB. Grafana can see the data but won't let me select all the fields when I try to "Add Query".
Output from my server shows that the DB is working:
show measurements
name: measurements
name
PORT
select * from "PORT"
name: PORT
time CardNo Counter Nodename PortNo value
---- ------ ------- -------- ------ -----
1511214407000000000 18 bcast_inpackets ALPRGAGQPN2 1 500
However, when I try to "Add Query" in Grafana, I can see PORT in "FROM" (which is what I want), but in the "WHERE" section, when I try to narrow my selection using CardNo, Counter, etc., it appears to behave randomly. If I select CardNo first, it will let me select 18 (see picture below), but then clicking "+" to add another criteria doesn't display the option for say "PortNo" (all I get is an empty dialog box). I can enter the field value manually (eg PortNo) but other users will be plotting graphs and won't necessarily know the underlying schema. Also, if I select Nodename first, then I can select CardNo (weird). I'd like it so the end user can specify ALL the fields (in this case CardNo, Counter, Nodename and PortNo).
My graphite template is this:
"[[graphite]]
# Determines whether the graphite endpoint is enabled.
enabled = true
database = "graphite"
# retention-policy = ""
bind-address = ":2003"
protocol = "tcp"
# consistency-level = "one"
templates = [ "ASR.PORT.* .measurement.Nodename.CardNo.PortNo.Counter"
]
and the data I feed to InfluxDB to test my setup is:
echo "ASR.PORT.ALPRGAGQPN2.18.1.bcast_inpackets 500 `date +%s`" | nc localhost 2003
Firstly, template is better written as:
"ASR.PORT.* .measurement.Nodename.CardNo.PortNo.field"
Which makes bcast_inpackets and any other value after PortNo into a field containing data. This reduces cardinality of series, which improves performance and scalability, by combining all counters into multiple fields on the same series as opposed to separate series with unique tags with their own value fields.
Grafana's influx query builder will filter tag values for the value of the already selected tags. In other words, if you select PortNo=1 and try to select another tag, only tag keys where PortNo=1 will be shown.
If you look at queries Grafana runs in browser, you will see something like show tag keys from PORT where PortNo='1' if PortNo=1 is already selected and different queries for other tags.
This is why you may not see other tags and why which tags you see depends on the tags already selected. This is by design so if you want something different you will need to adjust the schema by, for example, making PortNo and CardNo into fields instead of tags.
You might also be interested in InfluxGraph which can query InfluxDB via Graphite API and also supports same template configuration as InfluxDB.
Related
I am creating a line chart in a CloudWatch dashboard. I can create a line representing the frequency with which one string appears the logs, using a filter. But, I don't know how to create two or more such lines.
After selecting a log group, I run this query:
filter name = "first log string"
| stats count(*) as firstString by bin(1hour)
This generates counts of results that, in the Visiulization tab, are displayed as a line chart with a single line.
Now I want to add another line representing "second log string" on the chart. I assume I will have to modify the filter in some way, or add a second filter.
Here are some things that don't work:
adding a second name to the filter
trying filter #message or #name as this documentation suggests
simply pasting in a modified duplicate of the query
Further, I seem to lack documentation that explains how filter is supposed to work. Search engines keep sending me back to this Filter And Pattern Syntax AWS document which dosen't appear to give any actual examples using filter.
To answer my own question, I had to use an array in my filter. I also used the sum() function instead of count().
filter name in ["first log string", "second log string"]
| fields name = "first log string" as #first_string, name = "second log string" as #second_string
| stats sum(#first_string) as first_string, sum(#second_string) as second_string by bin(1hour)
Now I have a line chart with two lines representing the frequency of two logged items
The same question once again but with (I hope) better explanation:
I created the most simple case:
An Interactive Grid IG with data source EMP ( table with 14 records contains Ename, Job, HireDate, Salary etc. etc.)
Text field P7_ENAME
After running it looks like below:
What I would like to do is to copy Ename from selected record of IG to P7_ENAME field .
I found several tutorials (text and video) how to do it. Most of them suggest to create dynamic action SelectionChange on IG and when TRUE add a JavaScript code something like below:
var v_ename;
model = this.data.model;
v_ename = model.getValue( this.data.selectedRecords[0], "Ename");
apex.item( "P7_ENAME" ).setValue (v_ename);
and the second step is to create another action: Refresh.
So finally I have a dynamic action with two steps : the first one is a Java script code and the second refresh function on my P7_ENAME field.
Sounds simple and it is simple to repeat/implement. A guy (I suppose) from India published a video on YouTube (https://www.youtube.com/watch?v=XuFz885Yndw) which I followed and in his case it works good. In my case it simple does not work - field P7ENAME is always empty, no errors appears. Any idea why ? Any hints, suggestion ?
thanks for any help
K.
The best way to debug and achieve what you are trying to do is as follows:
create the Dynamic action with the following setup:
-when -> selection change[interactive grid],
-selection type -> region, region -> your IG region,
-client side condition -> javascript expression: ```this.data.selectedRecords[0] != undefined```
First action of the true of the DA with the type: execute javascript code and fire on initialization is turned on, code: console.log(this.data.selectedRecords);
Run your page, and check the browser console. You should see an array of columns when you select a record from that IG as follows:
Find in that array, which sort number of the array contains the data that you want to use for the page item. Let's say I want the 3rd element which is "2694" then I should change my dynamic action's execute javascript code to:
var value = this.data.selectedRecords[0][2];
apex.item( "P7_ENAME" ).setValue (value);
The last thing I should do is add another true action (and the refresh action at the end) to the same dynamic action with type 'SET VALUE' and 'PLSQL EXPRESSION' as type, put :P7_ENAME in the expression, items to submit P7_ENAME and affected element: item / P7_ENAME as follows:
I have a Master Detial with 2 interactive grids.
I would like to be able to genrate a link based on user input....is that at all possible?
To give a simple example:
Lets say I have website like https://www.google.com/
I would like a user to enter anything...for example "Prague"
Once this is entered, I would like APEX to generate a URL from it to result in: https://www.google.com/Prague
Now I know that Google search does not work like that, but I need that sort of mechanism for our internal company app. Is this possible?
Ideally , once the grid is saved the link in the Interactive grid only said "Prague" but if I click it, it would direct me to https://www.google.com/Prague
This can be achieved using the "JavaScript Initialization Code" attribute of the column.
Example on the EMP sample table (*). Functionality is that when a user enters a value in the ENAME column, it is converted to a google search url.
Create an editable IG on table EMP
Set the type of column ENAME to "Text Field"
Set "Javascript Initialization Code" for column "ENAME" to
function(config) {
config.defaultGridColumnOptions = {
cellTemplate: '&ENAME.'
};
return config;
}
Notice that the column now is a link. A user will have to open in new window to get the actual link value, since clicking the column will active the edit mode.
(*) Sample dataset can be installed using SQL Workshop > UTILITIES > Sample Data Sets > EMP/DEPT
yes, you can let user enter the value and by creating a dynamic action(choose the when attribute as whatever suits you) you can take that value and on another column, use that column as &Columnvalue. for example and concatanate it by using to base url using ||
I have 2 source. Oracle and SQL Server. I need to extract CustomerID from both and match. I need 2 outputs.
Number of CustomerID from Oracle
Number of CustomerID matching between Oracle and SQL Server.
Then, generate report and send it through mail to user.
Source - Oracle
Source - MS SQL
Joiner (Detail outer join with oracle)
Router
Group 1: CustomerID(Oracle) is not null and CustomerID(SQL Server) is null
Group 2: CustomerID from both not null
AGG transformation after both group to get count
Union to merge it
Load into target file
Now I will have to use Shell script to prepare mail and send it to user.
Is there way we can do it simple? like assigning count to workflow variable and then use it in Email task?
goto workflow:
open the session task and navigate to components tab
edit on sucess email and set type t0 non-reusable
click on edit button in value
click on edit button next to email text
enter "%l" . this will get the count of records and send to you in the email body.
How can I overcome this {Ajax call returned server error ORA-01403: no data found for} problem? Problem arises ,When I want to set Order_Status_Field value 2 in IG where query was Order_Status_Id=1.
My IG query was :
SELECT P.ORDER_ID, P.ORDER_STATUS_ID FROM ORDER_DETAILS P WHERE P.ORDER_STATUS_ID=1;
My Workspace Name: ZISHAN
User: ZISHANIIUC#GMAIL.COM
Pass: 123
Problem Page No: 3 (Order Report)
1. Before Updating Order Status:
2. After Updating Order Status:
I saw your are using standard "Interactive Grid - Automatic Row Processing (DML)" process, which is an AJAX approach. this apex behaviour is a call ajax using json format for data. so you have a filter on your sql query
SELECT T.ORDER_ID,
T.TABLE_ID,
T.TAKEN_BY,
T.ORDER_STATUS_ID,
T.TOTAL_COST
FROM ORDER_DETAILS T
WHERE T.ORDER_STATUS_ID=2
and you want to update your filter column (data has change) it's seem like apex do not find the prevouis data filter and return no_data_found (not really sure what happen ) but for solution : .
put your filter in interactive grid --> action button ---> filter
or
write your own custom process
When i tried do alter the process from the "Interactive Grid - Automatic Row Processing (DML)" that apex creats, for my own custom PL/SQL Code i needed to choose one of the columns from the query to be the primary key, and then i could use the pl/sql custom process as found here on this blog:
https://mikesmithers.wordpress.com/2019/07/23/customizing-dml-in-an-apex-interactive-grid/ without the no data found error.