search logs with only upper-case letters on stackdriver - stackdriver

I need to filter logs on stackdriver.
Can I write filter with upper-case letters?
For example, when I have logs like
ERROR xxx
error xxx
and I'd like to pick up just
ERROR xxx
So how can I write filter on this case?

Looking for logs based on letter case for the string you are looking for is not possible using Stackdriver Logging since string comparison is not case sensitive, as stated in the documentation. If you want to make some distinction between those 2 logs, you will need to specify it in another way. Reading the provided documentation might give you other alternative solutions for what you wish to achieve.

Related

How do I provide my Identity / Email when connecting to NCBI through Rentrez?

My project head is telling me that its unacceptable to connect with NCBI to retrieve sequence entries without sending along identifying information such as our institution email. They claim this means NCBI won't instantly block our connection if we violate their user guidelines, they'll 'email' us first. We are using Rstudio with the Rentrez package to retrieve protein sequences from NCBI Genbank.
But I'm not certain that's necessary or IF rentrez has any way to even do that. For reference this is general format of our code.
sequence <- entrez_fetch(db="nuccore", id=**accession_number**, rettype="fasta")
Rentrez says on their documentation: "The NCBI will ban IPs that don't use EUtils within their user guidelines. In particular /enumerated /item Don't send more than three request per second (rentrez enforces this limit) /item If you plan on sending a sequence of more than ~100 requests, do so outside of peak times for the US /item For large requests use the web history method (see examples for entrez_search or use entrez_post to upload IDs)"
Both entrez_search and entrez_post include an argument called "web_history A web_history object for use in subsequent calls to NCBI" I'm not sure if this is what I'm looking for though.
I can't find any arguments or functions etc. which allow the user to send identifying information to NCBI when connecting.
It seems like you need an API key. You can get one from your NCBI account interactively, and it needs to be specified in your .bash_profile (at least on a mac, using bash, not sure your OS / terminal of choice here).
For command line usage it just needs to be set as a variable with the following line added to your profile:
export NCBI_API_KEY=<yourkeyehere>
Then as long as R is loading up that profile when it spins up, you should be fine.
EDIT:
A bit of a tangential note here, you can grab files from the FTP site with utilities like curl and wget, or even Biostrings' functions like readDNAStringSet() without an API key, but if you're going to access things with eutils, you need one - as long as you're going OVER the X-number of queries per second - but if you're under that threshold, i don't think they care that much.

Application insights group with regex

I have the following problem, we have some .net Web API's which i want to monitor.
So lets say i have one basic API which has one Method with the following options:
/api/appliances/list
/api/appliances/list/userid
/api/appliances/list/userid/appliancecategory
In fact i have some more operations, but this is not really important,
So i want a query which gets the average response type per operation
I am able to select it with a regex like this:
requests
| where name matches regex "^GET \\/api\\/appliances\\/categories\\/[\\w]+$"
Does someone have an idea how to accomplish this
Maybe you should add | project name, xxx to end of the query.
A similar issue can be found here.

How do you get the firebase log viewer to show line numbers?

Is there a way to get line numbers from log entries, for example when you do a:
console.log('Already a Thumbnail.');
It would be nice to see more than:
Instead it would be useful to also see the line number, particularly as functions get larger, is this possible? Thanks!
The Firebase Cloud Functions log doesn't have the ability to show line numbers as it's basically reading from stdout (or similar).
You may be able to glean further insight by viewing logs through the Cloud Functions Stackdriver Logging UI though.
Also, it's worth adding more details to your logs or using tags to distinguish between different console.log calls, for example:
console.log("ifThumbnailExists: Already a Thumbnail.");
And if you want to use the same log message on multiple lines, another line may use:
console.log("ifSmallImage: Already a Thumbnail.");
Ultimately the idea is that you should be able to tell what line or method the logs are coming from by providing additional details and using unique log messages.

How to specified multiple attributes in the findscu command

All, Forgive me I am a newbie in the DICOM world. I tried to learn the DCMTk tools to talk with PACS server. But didn't found much tutorial or sample in the internet to know enough about it .Currently I just have the offical document to read.
I just tried the findscu.exe to test c-find command .
I remembered C-Find would return what specified in the request message. for example. If I only specifed the condition Patient Name ='abc' then the reponse would return only attribute Patient Name. Nothing else.( If it is not right . Please correct me.)
So I want to know how to return all the attribute of response DICOM.
Thanks.
How to specified multiple attributes in the findscu command.
Just specify multiple --key (-k) options on the command line. Alternatively, you could also use a "query file" as described in the man page.
So I want to know how to return all the attribute of response DICOM.
Then, you have to specify all attributes (keys) you are interested in. That's how C-FIND works.
By the way, if you are querying a PACS (Query/Retrieve SCP), then you also have to specify the Query/Retrieve Level (0008,0052), e.g. "PATIENT".
Currently I just have the offical document to read.
If you think that the examples in the man page of the findscu tool are not sufficient (and you are actually querying a PACS), this HOWTO might be useful too.
It is totally legal to send a request with Patient Name information only and the PACS will return all matching datasets.
Each dataset should at least contain all mandatory fields like Date of Birth, Patient ID, and so on, depending on the Query Level.
What information is returned by the PACS system on each Query Level should be specified in the DICOM Conformance Statement of the vendor. I would recommend to take a look at this to know, how to set up a valid query to get the information you need and/or if the information is provided by the PACS system.
It is best to include the Unique key and Required Key Attributes in the request attribute list. Also, include the optional attributes (if supported by SCP) when you wish server to return values for them. Please refer to DICOM Standard PS 3.4 section C.2 and C.3 detail information on Query/Retrieve service. List of attribute and type (Unique, Required, Optional) is listed section C.6.1.1.2 (Patient Level), C.6.1.1.3 (Study Level) and so on.

Is the Google Id/Subject string returned from a GoogleIDToken validation actually a number?

I'm currently looking into server-side validation of a GoogleIDToken for Google Sign-in (Android & iOS). Documentation here
In the example, the "sub" field in the object returned by the Google API endpoint is read as a string, but it looks like it may actually be a (really big) number.
Some other tests using some users on my side also show big numbers.
Looking deeper in the Payload documentation, it looks like this value could be null, but outside of this possibility, can we assume that this string is actually a number?
This is important because we want to store it in a database, and saving it as a number might actually be more efficient than a string.
I work on the team at Google: this value should be stored as a string, it may be parseable as a number, but there is no guarantee, do not rely on that assumption!
If you're going to do arithmetic on it, then store it as a number. Otherwise, don't.
This is a general rule.

Resources