You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ragini Thakur <ra...@cybage.com> on 2011/04/15 07:19:45 UTC

Urgent Regular expression help

Hi,

 

When the request is sent I get response as below[  JSON response}

 

[{"messages":432234,"message_stats":{"ack":314636,"ack_details":{"rate":
232.12972028330995,"last_event":1302774804792},"deliver":746578,"deliver
_details":{"rate":558.466732103636,"last_event":1302774804792},"deliver_
get":746578,"deliver_get_details":{"rate":558.466732103636,"last_event":
1302774804792},"publish":748153,"publish_details":{"rate":542.6778771821
846,"last_event":1302774808284}},"name":"ViApiQueue","vhost":"/","durabl
e":true,"auto_delete":false,"owner_pid":"none","arguments":{},"pid":"<ra
bbit@testing_prod_mq1.530.0>","node":"rabbit@testing_prod_mq1","exclusiv
e_consumer_pid":"","exclusive_consumer_tag":"","messages_ready":0,"messa
ges_unacknowledged":432234,"messages":432234,"consumers":2,"memory":2222
02952,"backing_queue_status":{"q1":0,"q2":0,"delta":["delta","undefined"
,0,"undefined"],"q3":0,"q4":0,"len":0,"pending_acks":432234,"outstanding
_txns":0,"target_ram_item_count":"infinity","ram_msg_count":0,"ram_ack_c
ount":0,"ram_index_count":0,"next_seq_id":773316,"persistent_count":4322
34,"avg_ingress_rate":575.4686943831779,"avg_egress_rate":575.4686943831
779,"avg_ack_ingress_rate":575.4686943831779,"avg_ack_egress_rate":238.3
970450351693}}]

 

I want to extract few values from this response such as messages,
unacknowledged and rate etc.

 

I have used "Regex Extractor" to extract message value. My Regex is =
"messages":([0-9]*?), but I am not getting expected value. I am getting
default value set i.e. "-1"

 

Template: 1$1

Match no: 0

Def Value : -1

 

What is wrong in the Regex?

 

Regards,

Ragini 

 



"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." 
www.cybage.com


Re: Urgent Regular expression help

Posted by Rajiv Nanduani <ra...@gmail.com>.
                    Regular Expression: messages":(\d+)
                    Template: $1$
                    Match No: 1
                    Default Value: failed
          Debug Sampler
     View Results Tree


Add Debug Sampler and  Look in the Debug Sampler results you will find the
all the values

Good Luck,


On Fri, Apr 15, 2011 at 1:19 AM, Ragini Thakur <ra...@cybage.com> wrote:

> Hi,
>
>
>
> When the request is sent I get response as below[  JSON response}
>
>
>
> [{"messages":432234,"message_stats":{"ack":314636,"ack_details":{"rate":
> 232.12972028330995,"last_event":1302774804792},"deliver":746578,"deliver
> _details":{"rate":558.466732103636,"last_event":1302774804792},"deliver_
> get":746578,"deliver_get_details":{"rate":558.466732103636,"last_event":
> 1302774804792},"publish":748153,"publish_details":{"rate":542.6778771821
> 846,"last_event":1302774808284}},"name":"ViApiQueue","vhost":"/","durabl
> e":true,"auto_delete":false,"owner_pid":"none","arguments":{},"pid":"<ra
> bbit@testing_prod_mq1.530.0>","node":"rabbit@testing_prod_mq1","exclusiv
> e_consumer_pid":"","exclusive_consumer_tag":"","messages_ready":0,"messa
> ges_unacknowledged":432234,"messages":432234,"consumers":2,"memory":2222
> 02952,"backing_queue_status":{"q1":0,"q2":0,"delta":["delta","undefined"
> ,0,"undefined"],"q3":0,"q4":0,"len":0,"pending_acks":432234,"outstanding
> _txns":0,"target_ram_item_count":"infinity","ram_msg_count":0,"ram_ack_c
> ount":0,"ram_index_count":0,"next_seq_id":773316,"persistent_count":4322
> 34,"avg_ingress_rate":575.4686943831779,"avg_egress_rate":575.4686943831
> 779,"avg_ack_ingress_rate":575.4686943831779,"avg_ack_egress_rate":238.3
> 970450351693}}]
>
>
>
> I want to extract few values from this response such as messages,
> unacknowledged and rate etc.
>
>
>
> I have used "Regex Extractor" to extract message value. My Regex is =
> "messages":([0-9]*?), but I am not getting expected value. I am getting
> default value set i.e. "-1"
>
>
>
> Template: 1$1
>
> Match no: 0
>
> Def Value : -1
>
>
>
> What is wrong in the Regex?
>
>
>
> Regards,
>
> Ragini
>
>
>
>
>
> "Legal Disclaimer: This electronic message and all contents contain
> information from Cybage Software Private Limited which may be privileged,
> confidential, or otherwise protected from disclosure. The information is
> intended to be for the addressee(s) only. If you are not an addressee, any
> disclosure, copy, distribution, or use of the contents of this message is
> strictly prohibited. If you have received this electronic message in error
> please notify the sender by reply e-mail to and destroy the original message
> and all copies. Cybage has taken every reasonable precaution to minimize the
> risk of malicious content in the mail, but is not liable for any damage you
> may sustain as a result of any malicious content in this e-mail. You should
> carry out your own malicious content checks before opening the e-mail or
> attachment."
> www.cybage.com
>
>


-- 
RAJIV KUMAR

<http://rajivkumarnandvani.wordpress.com/>
<http://learnqtphelp.blogspot.com/>

RE: Urgent Regular expression help

Posted by Ragini Thakur <ra...@cybage.com>.
Thanks All for your response.

My issue is resolved with Regular Expression: messages":(\d+). Thanks
Rajiv.

Regards,
Ragini Thakur


-----Original Message-----
From: Nermin CALUK [mailto:nermin@atlantbh.com] 
Sent: Friday, April 15, 2011 1:47 PM
To: 'JMeter Users List'
Subject: RE: Urgent Regular expression help

Using http://www.gskinner.com/RegExr/ can sometimes help catch the regex
problems

-----Original Message-----
From: Felix Frank [mailto:ff@mpexnet.de] 
Sent: Friday, April 15, 2011 9:01 AM
To: JMeter Users List
Subject: Re: Urgent Regular expression help

> I have used "Regex Extractor" to extract message value. My Regex is =
> "messages":([0-9]*?), but I am not getting expected value. I am
getting
> default value set i.e. "-1"

Is the equals sign part of your regex? If so, that's a problem.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org



"Legal Disclaimer: This electronic message and all contents contain information from Cybage Software Private Limited which may be privileged, confidential, or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution, or use of the contents of this message is strictly prohibited. If you have received this electronic message in error please notify the sender by reply e-mail to and destroy the original message and all copies. Cybage has taken every reasonable precaution to minimize the risk of malicious content in the mail, but is not liable for any damage you may sustain as a result of any malicious content in this e-mail. You should carry out your own malicious content checks before opening the e-mail or attachment." 
www.cybage.com



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Urgent Regular expression help

Posted by Nermin CALUK <ne...@atlantbh.com>.
Using http://www.gskinner.com/RegExr/ can sometimes help catch the regex
problems

-----Original Message-----
From: Felix Frank [mailto:ff@mpexnet.de] 
Sent: Friday, April 15, 2011 9:01 AM
To: JMeter Users List
Subject: Re: Urgent Regular expression help

> I have used "Regex Extractor" to extract message value. My Regex is =
> "messages":([0-9]*?), but I am not getting expected value. I am getting
> default value set i.e. "-1"

Is the equals sign part of your regex? If so, that's a problem.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Urgent Regular expression help

Posted by Felix Frank <ff...@mpexnet.de>.
> I have used "Regex Extractor" to extract message value. My Regex is =
> "messages":([0-9]*?), but I am not getting expected value. I am getting
> default value set i.e. "-1"

Is the equals sign part of your regex? If so, that's a problem.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org