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
Add option to map API tracking parameter to custom variable in log importer script. #7151
Comments
it's a nice, clean re-usable solution. I like it! @quba did you have a chance to test it and can confirm the feature? |
@mattab What did you think about the second paragraph? |
Yes, it could be useful to have this ability but maybe we wait for some use cases? AFAIK it would not invalidate this PR and new options so it could be done later |
It wouldn't invalidate it, but it would be redundant since you could use the other options to do what's in this use case. |
What would be equivalent to |
|
ok looks nice! btw is there an option to list the regex groups available for a given log file? |
It would be for a format, I was planning on adding the info to the help documentation. |
I'll make the changes, please don't merge until I finish them. |
@mattab I've modified the pull request, new options now include:
First 3 are for @quba's use case. Last one can be combined w/ other ones to track any w3c log field that the importer doesn't natively recognize in a custom variable. Let me know what you think. |
@diosmosis how can I choose which custom variable will be used? |
You mean which index? Or what the custom variable name to use? For name, --regex-group-to-visit-cvar="userid=User Name". I don't think index matters. |
after a quick review, looks good to me! 👍 |
@diosmosis in the morning i'm thinking, maybe we could add a test case in python for these new parameters? they can be difficult to grasp and this would ensure we don't regress without noticing. |
There are tests in ImportLogsTest.php, do you mean add more tests to log-analytics/tests/*? |
yes |
…re userid not set in hit object, fix ignore group option value spliting.
Add option to map API tracking parameter to custom variable in log importer script.
This pull request adds two options to import_logs.py that move tracking API parameters to custom variables. This is for a PRO request to allow not tracking user IDs from
cs-username
using uid and instead track via a custom variable. To do this, you would specify--api-arg-to-visit-cvar="uid=User Name"
. The option references tracking API parameters so it can be used w/ any format.I think using API parameters might be limiting however. After thinking about it, it might be better to make it use regex groups. Then we can add two more options,
--ignore-fields=userid
,--w3c-field-regex=my-custom-field=myregex
so users can import any field they want into a custom variable.Includes change to ImportLogs system test and fix for import log custom variable handling (old behavior was to not set multiple custom variables if they were set already instead of simply adding custom variables).
@mattab @quba Can you let me know what you think?
The text was updated successfully, but these errors were encountered: