# How to define a short lived and sensitive environment variable WHILE the job is already running to benefit from log sanitation?

**URL:** <https://travis-ci.community/t/how-to-define-a-short-lived-and-sensitive-environment-variable-while-the-job-is-already-running-to-benefit-from-log-sanitation/13605>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [February 17, 2023, 1:50pm UTC](https://travis-ci.community/t/how-to-define-a-short-lived-and-sensitive-environment-variable-while-the-job-is-already-running-to-benefit-from-log-sanitation/13605 "2023-02-17T13:50:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markuszoeller](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/markuszoeller/32/8519_2.png) [@markuszoeller](https://travis-ci.community/u/markuszoeller)\
**Post date:** [February 17, 2023, 1:50pm UTC](https://travis-ci.community/t/how-to-define-a-short-lived-and-sensitive-environment-variable-while-the-job-is-already-running-to-benefit-from-log-sanitation/13605/1 "2023-02-17T13:50:25Z")

</div>

I have trouble to understand how I can influence the log sanitation in Travis WHILE the job is already running. I’m aware of the environment variable feature, but I would need to define them on-the-fly.

My use case:  
I have my `.travis.yml` file, which calls `source my_script.sh` , and that script contains among others this line `export TOKEN=$(curl <artifactory-create-secret-token>)` . The env var `TOKEN` is sensitive and only valid for a very short time and must be created on the fly every time, so I can’t put it into the Travis settings as sensitive env var. I’d like to let Travis know that this needs to be treated as sensitive, so that `echo $TOKEN` gets sanitized in the Travis logs with `***` or `[secure]` .

How can I do that?
