Cloudwatch Dashboard - Hide x-axis label from a bar graph - amazon-cloudwatch

I am currently using cloudwatch insights to plot a bar graph on dashboard by querying cloudwatch logs. The log data (which now will become label) is a bit sensitive to be shown up on the dashboard, however while plotting the bar graph continues to show the label.
Here's the insight query that I'm using.
filter #message like /Request class .* student /
| parse #message /Request class (?<classId>\S+) student (?<studentId>\S+)/
| stats count(*) as students, count_distinct(class) as classes by studentId
| sort students desc
| limit 20
Here studentId is something we don't want to show up on the graph.
I'm looking for either
Is there a way to hide or obfuscate the label in the dashboard?
If not, can we try modifying the insights query to help obfuscate the same ?

Related

How to format splunk graphs to show multiple lines (one line for each method)?

I am new to splunk reports, I am trying to achieve the following:
I want to generate splunk logs report (graphical) for API performances with execution time on x-axis and method names on y-axis. I am trying to run following query:
cs_dataowner_id="ICTO-31263" cs_stage = UAT
| search cs_component_id="icomply-gpat-api-buslogs"
| search Action=API_PERFORMANCE
| table Message Execution_Time
| sort by Execution_Time desc
Expected line graph should show a single line for each method (API) expanding with time on x axis hence number of lines on y-axis should be equal to number of apis/methods called in that time range.
Current output: A single line on y axis for all the methods (here I have 2 apis).
I tried all the formatting options but nothing worked.
Screenshot:
Instead of piped search commands, do it all on the first line:
cs_dataowner_id="ICTO-31263" cs_stage=UAT cs_component_id="icomply-gpat-api-buslogs" Action=API_PERFORMANCE
Instead of the sort and table commands, use chart:
| chart count(Message) as Messages over Execution_Time by Message
This command graphs the number of calls to each API with Execution_Time on the X-axis and separate lines for each API (Message).

How do I make a stack column chart with two events organized by services?

Basically I need to make a column chart with the different endpoints along the x axis (services such as log in, etc.) with each endpoint having a unique column stacked with two colors, red for service error events and green for service events.
I can get something with a search string like this:
my search EVENT="[SERVICES]" OR EVENT="[SERVICE_ERROR]" | chart count by EVENT, ENDPOINT
though its event on the x axis (but showing both services and service error like I need) with the endpoints being different colored stacked in the chart.
Yet reversing this causes ONLY SERVICE EVENTS to show up, which is beyond my reasoning since service errors appear in the first search.
Above is just something I tried. I also tried:
my search | fields ENDPOINT "[SERVICE]" "[SERVICE_ERROR]"
according to the splunk documentation on stacking charts here:
https://docs.splunk.com/Documentation/Splunk/7.1.1/Viz/ColumnBarCharts
(last example at bottom of page).
I wanted to make sure I was thorough with my explanation but in short...
My goal is to have the all the endpoints displayed on the x axis with the count of the different service events and service error events as the actual graph data as one column split into two colors for both events.
Thank you for any help!!
I found the answer and wanted to share in case anyone else might find this helpful:
First, I made a unique field for error using the field extractor. "[SERVICE_ERROR]" wanted to link to all other events similar to it so I had to use "error_message" to extract my errors.
Next I added this to my search string:
....... | stats count(eval(match(EVENT,"[SERVICE]"))) AS service count(error) AS error BY endservice
This calculates a table that finds the count of both the event "[SERVICE]" and the field "error" and renames them using "AS/as". The field "endservice" is a field extraction I use to get more accurate endpoints.
Finally I go to my chart's format option (near the magnifying glass and three dots in the upper right hand corner, it looks like a paint brush) and click on it. After that I selected "stacked column" (the middle one).
The voila! I have my stacked graph of two different data types! I hope this helps someone else someday.

How to implement multiselectable facet checkboxes with amazon cloudsearch?

I am using amazon cloud search in my website.My website is an e learning portal where i have content of types videos,questions,courses etc.Each type of content having different levels like 1st grade,2nd grade,3rd grade etc of different curriculum like cbse,state board etc and of different educators like xyz,abc,pqr etc.I am filtering my content based on facet and also filtering facet based on facet selection.My filter is working like amazon cloudsearch console.In console we can not do multiple selection.My problem is that when i select one faceted checkbox then page loads and hides other filter options.I want to keep open all facets to perform multiple checkbox filter.Please help how to do this.
You need to 'OR' the facet selections together. For example:
q=algebra&fq=(and (or grade:1 grade:2) (or educator:abc educator:xyz))&facet.grade={}&facet.educator={}&facet.curriculum={}
See http://docs.aws.amazon.com/cloudsearch/latest/developerguide/faceting.html

Scrapy: Item discrepancy

Scenario: a page with multiple items, each consisting of title, description, image. What happens when one of the items are missing the title? How does scrapy handle it? It seems that scrapy blindly selects all titles //div[id='content']/ul/li/div[id='title']/text(),
Expected output is that that row will have a missing title. But I fear that since it blindly selects all titles on the page without considering the item context. If the 5th item is missing title, wouldn't it mistakenly use the 6th item's title instead?
title1 | description | image
.
.
title4 | description | image
title6 | description | image <--- it's supposed to be missing the title.
| description | image
Does scrapy have a way to deal with this problem?
A workaround I was thinking would be to look at the parent item element, and then, look inside that item. If something is missing don't show it.
there are variety of ways you can handle this situation
1) you can implement a pipeline that can skip items that are not required
2) you can add check in your extraction part to only yield/return an item that is required
you needs to understand Scrapy is a high level crawling Framework , that is also providing builten support for data extraction , you can use any library for extraction you would like to.

Grails - 2 domains and 1 form create/update/edit issues

Having some mega frustration set in.Maybe Im trying grails too much like rails and active record.
I have 2 domains.The parent is called 'report' and the child 'category'.
The user creates a new report and if they like they can add a category. The report can only have one category. However I would like to allow reports to be sorted by category or listed by category or even counted by category. Yes this column could go into the reports domain but I would like separation for future cases. so below I have my domains;
Domain 1 = Report
class Report
string reportname
string reportype
Domain 2 = category
class Category
Report report
string categoryname
I have 2 controllers, 1 for report 1 for category both with crud methods and no scaffold.
How do I set the view to create/edit/update the category domain while in the report _form?
I have read through the gorm docs, grails docs, others but still am stumbling on this.
Do I need to edit my report controller to handle the category domain? i.e import category and supply category def with each method for /edit/update/create.
Do I need to edit the report form to get the report params and pass this into a hidden field for the category name field so that when a save action is called the category domain commits the cat name and reportId.
Is my model all wrong? I have tried hasone, hasmany belongsto however I need to keep the category separate from the reports because I want to be able to show a page of reports separated by categories and allow only unique category names for a bunch of reports to reduce spelling mistakes in category names. i.e. I want to set a category name and associate it to a report.
New to grails so forgive me. Maybe I need to sit and have a beer and read more.
cheers
There are many ways to handle your scenario. One way to do this is to use redirect in your ReportController and pass in the params to CategoryController.