# pt-stalk not parsing --config correctly

**URL:** <https://forums.percona.com/t/pt-stalk-not-parsing-config-correctly/4861>\
**Category:** Percona Toolkit\
**Created:** [April 27, 2016, 2:35pm UTC](https://forums.percona.com/t/pt-stalk-not-parsing-config-correctly/4861 "2016-04-27T14:35:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bardown](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@bardown](https://forums.percona.com/u/bardown)\
**Post date:** [April 27, 2016, 2:35pm UTC](https://forums.percona.com/t/pt-stalk-not-parsing-config-correctly/4861/1 "2016-04-27T14:35:16Z")

</div>

For instance when using multiple configs, it seems that the LAST config is the only one honored:

pt-stalk --config ./deadlocks.conf,./longquery.conf,./highcnx.conf --dest=/var/lib/mysql/pt-stalk --log=/var/log/mysql/pt-stalk/pt-stalk.log --sleep=30 --defaults-file=/etc/percona-toolkit.conf

output:  
2016\_04\_25\_15\_51\_59 Starting /usr/bin/pt-stalk --function=status --variable=Threads\_running --threshold=100 --match= --cycles=5 --interval=1 --iterations= --run-time=30 --sleep=30 --dest=/var/lib/mysql/pt-stalk --prefix= --notify-by-email= --log=/var/log/mysql/pt-stalk/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=

In this example, my longquery.conf is not triggering, but if I put it as the last argument in the list of configs, it does:  
[root@testl1 configs]# pt-stalk --config ./deadlocks.conf,./highcnx.conf,./longquery.conf --dest=/var/lib/mysql/pt-stalk --log=/var/log/mysql/pt-stalk/pt-stalk.log --sleep=30 --defaults-file=/etc/percona-toolkit.conf  
2016\_04\_25\_15\_52\_46 Starting /usr/bin/pt-stalk --function=/usr/local/bin/mysql/pt-stalk/functions/longquery.sh --variable=Long\_Query --threshold=0 --match= --cycles=5 --interval=1 --iterations= --run-time=30 --sleep=30 --dest=/var/lib/mysql/pt-stalk --prefix= --notify-by-email= --log=/var/log/mysql/pt-stalk/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=  
2016\_04\_25\_15\_53\_52 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long\_Query)=1, matched=yes, cycles\_true=1  
2016\_04\_25\_15\_53\_53 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long\_Query)=1, matched=yes, cycles\_true=2  
2016\_04\_25\_15\_53\_54 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long\_Query)=1, matched=yes, cycles\_true=3  
2016\_04\_25\_15\_53\_55 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long\_Query)=1, matched=yes, cycles\_true=4  
2016\_04\_25\_15\_53\_56 Check results: /usr/local/bin/mysql/pt-stalk/functions/longquery.sh(Long\_Query)=1, matched=yes, cycles\_true=5  
2016\_04\_25\_15\_53\_56 Collect 1 triggered  
2016\_04\_25\_15\_53\_56 Collect 1 PID 50385  
2016\_04\_25\_15\_53\_56 Collect 1 done  
2016\_04\_25\_15\_53\_56 Sleeping 30 seconds after collect

Version:  
pt-stalk 2.2.7 & 2.2.17

I would expect the --config file,file,file to trigger off ALL configs, not just the last in the list. An example of one of the configs/functions

configs/longquery.sh:

# Config for Queries running 20m or more

function=/usr/local/bin/mysql/pt-stalk/functions/longquery.sh  
variable=Long\_Query  
threshold=0 # Trigger if counter is \>= 1  
dest=/var/log/mysql/pt-stalk/  
log=/var/log/mysql/pt-stalk.log  
pid=/var/run/pt-stalk.pid

function/longquery.sh:  
trg\_plugin() {  
mysqladmin --defaults-file=/etc/percona-toolkit.conf ‘processlist’ | awk -F|   
‘BEGIN{counter=0} {if ($6 ~ /Query/ && $7 \> 60 ) counter++; } END {print counter}’  
}
