Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a question about logparser. #1

Open
Shin-Dong-Ik opened this issue Jan 30, 2019 · 2 comments
Open

I have a question about logparser. #1

Shin-Dong-Ik opened this issue Jan 30, 2019 · 2 comments

Comments

@Shin-Dong-Ik
Copy link

How are you.
I'm currently using LogParser to analyze the DNS log,
If the value of a particular field in the first line of the Log file is stored as a number, the string data in the field is not read.
I wonder if there is a way to check whether the data in that field is a letter or a number.

@JamesSkemp
Copy link
Owner

Sorry for the delay.

I'd have to see your query to know more, but perhaps try TO_STRING in your SELECT or WHERE clause? https://logparserplus.com/functions/#function_TO_STRING

I'm not at a Windows machine at the moment, but you could also see what TO_INT gives you on a string and then in your WHERE clause include a check to exclude anything that isn't a string.

@Shin-Dong-Ik
Copy link
Author

My query is simple:

LogParser -i: TSV -nskiplines: 30 -headerRow: off -iSeparator: spaces -nSep: 1 -e: 10 "SELECT to_string (field4) as ThreadID FROM "File" "

If you test with the above query, the first line's ThreadID value is numeric, and if the middle ThreadID value contains string data, an error of "Error while parsing field Field4: Value is not a relative integer" occurs.
Conversely, if the first line's ThreadID value contains a string, and the number is in the middle, no error occurs.

If I understand it correctly, is it possible to put a condition in Where clause to exclude Int type data?
If possible, please give me a sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants