Filter for specific string and include 2 following rows - amazon-cloudwatchlogs

I'm doing some diagnostics for our application by searching for some specific messages on cloudwatch. A downside to searching for errormessages is that only the rows that match the string get returned, and sometimes valuable information is also included in the rows that were logged right after the log that was returned.
Is there a method of querying for a row with a specific value, and have a range of logs before and/or after this row included in the result?

The only way you can do this is to run another search without the filter, but restricting the time window to around the event that you found. At the moment, you cannot get the before/after log events through a single search.

Related

Smartsheet: Identifying location of a Column ID without a Sheet ID

We have a custom implementation of the SmartSheet Bridge which is returning the following error in our Run Log:
"The value for cell in column 3928364019935108, INPUT, did not conform to the strict requirements for type CHECKBOX."
The problem is we don't know which sheet this is occurring in which is making it hard to understand what the root cause of the problem is. Is there a way to identify the location of a column without a Sheet ID? Note we have six-thousand Sheets and it's not practical to do this manually.
The path of least resistance for you might be to contact Smartsheet support to explain your scenario and ask for their help in identifying the sheet.
If Smartsheet support is unable to assist, then you could write a script that'd programmatically iterate through all of the sheets that the specified account has access to doing the following for each sheet:
Issue a Get Column request the current sheet.
If the request succeeds, you've found the sheet that contains the specified column --> capture/output sheet ID and sheet name and exit the loop (end processing).
If the request fails (i.e., returns a 404 error code to indicate column not found), move on to the next sheet.
Note that if you're program needs to issue hundreds or thousands of Get Column requests before it finds the sheet and ends processing -- you'll need to insert pauses between batches of requests so that you don't get a rate limiting error (error code 429). The Smartsheet API docs contain info about rate limiting.
If you need help with the script, update your question with a language tag to indicate what language you're going to be using, and add a comment here on my answer. Depending on the language you're using, I may be able to provide more help regarding the specifics of the script.

Kibana - what logs are not reporting

I am currently using kibana 5.0 almost 45 log sources are integrated with kibana like iis,vpn ,asa etc.now my question is how to create a visualization to check what logs sources are not reporting to kibana.can anybody help on this?
Quick and dirty solution...
Make sure each log source is given a unique and meaningful tag as soon as their data enters the logstash workflow.
As each document is processed write an entry to a separate index, call it masterlist.idx (do not give this index a date suffix). Use the tags you assigned as the document ID when you write entries to masterlist.idx.
The masterlist.idx should really just contain a list of your log sources with each entry having a timestamp. Then all you've got to do is visualise masterlist showing all the entries. You should have 45 documents each with a timestamp showing their latest updates. I think the default timepicker on Kibana's discover tab will do the job. Any sources that haven't been updated in X days (or whenever your threshold is) have a problem.

Most Performant way to implement time-dependent status

Central to a project I'm working on is a highlighting-mechanic that can be applied to certain items on the website. The idea is, that this highlighted-status is only active for a certain amount of time.
I'm trying to find the most performant way to achieve this (in querying, setting status, checking status and revoking it)
A first approach would be to set simply set a value 'highlighted:true' to the item. This seems to be the most performant way to query for highlighted items. The Drawback I see here, is that there also needs to be stored a date for the highlighting-action, but furthermore there needs to run an interval to check on the highlighted items and potentially revoke their highlighted status. Also the exact moment when the item stops beeing highlighted can't be determined exactly, since its depending on the interval of the check-function.
A second approach would be to mainly store the date of the highlighting-action and run the query against it. It seems that the query of highlighted objects is way less performant, since every item ever is beeing checked, and on top its not just a boolean, but a proper function that throws those differnt date-values around to check if it is still valid. On the upside there is no external cleanup-function neccessary and every highlighting period ends perfectly on time.
Would love to have your input on this. Is there maybe a clever pattern on this?

ExpressionEngine missing channel entries

I am working on a new web app which is based in ExpressionEngine and for the most part I am basing the content on channel entries. However I am experiencing some very weird issues with the exp channel entries tag in that it is not returning all relevant entries each time. I can't figure out what's going on with it as the entries are definitely available when viewing them in the control panel, and they will also show up as requested in my template, but sometimes they just disappear and/or are not processed properly. This is the case for large and small sets of entries also, ranging from 3 channel entries which fit the criteria specified within the exp tag to 500 entries.
Any thoughts or feedback would be greatly appreciated.
There could be a number of things going on here so here are some things to look at, just in case;
If the entries have entry dates in the future - you'll need your channel entries tag to have the parameter show_future_entries = "yes"
Likewise if the entries are closed, or expired, you'll need to add show="open|closed"
Are you looking at a particular category and these entries aren't assigned to the category?
Are you looking at a particular category but have exlcuded category data from the entries tag
Are you retrieving more than 100 entries? There is a default limit of 100 entries returned unless you specify a limit parameter.

Preserve everything count and get filtered results in t-sql?

I have created a complex sql server 2008/coldfusion search page, that searches thru a variety of tables.
On the left is a list of the categories, plus an everything category, by each category or type of result is a total number of results of that type found in the current search result.
I have everything fine, but I am hoping there is a more optimal approach.
Because everytime i filter the search to a specific category, i still have to get all the results, so as to make sure the everything category has the correct totals.
And because of this, I have realized this is a problem I've had in lots of other programs in coldfusion/sql.
Where you want to reduce the number of results by some field in the select, but you need to keep the original recordcount total.
But you really don't want to re-run the whole massive query everytime, when you just need to get the trimmed results.
This program is 1 cfc, 1 cfm, 1 stored procedure, and jquery/ajax inside the cfm to call the cfc.
The cfm calls the cfc when it originally get's a form submitted search request, and then any filtering does the same thing.
However if there are more than 20 results then it show's a button at the bottom to do via ajax get 20 more records.
My main goal is to improve performance, make sure i keep an accurate record of what the record count is before any filtering is done, without having to rerun the unfiltered query every time.
This is a kind of complex problem, so there might not be any answers...
Thank you all for trying..
I would run the "big" query once, then pop it into a SESSION variable. Then I'd use Query-of-Query to return subsets based on filters.
The main query always exists, so you can query against that or use metadata like bigQuery.recordCount. Your QofQ is a smaller set of data you can use for display. And you can re-apply filters without having to return to the database.
Well you need to run the query (or a count(*)) at least once to get the total number. You could:
Cache this query and refer to the
cached query's recordcount again
and again
Store the record count in the session scope until the next time it is run for this user