# Onstreamcreate - getQueryStr()

**URL:** https://community.wowza.com/t/onstreamcreate-getquerystr/93928
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [October 7, 2021, 11:39am UTC](https://community.wowza.com/t/onstreamcreate-getquerystr/93928 "2021-10-07T11:39:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kousthub\_Gangarapu](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@Kousthub\_Gangarapu](https://community.wowza.com/u/Kousthub_Gangarapu)
#### Post date: [October 7, 2021, 11:39am UTC](https://community.wowza.com/t/onstreamcreate-getquerystr/93928/1 "2021-10-07T11:39:20Z")

</div>

Hello,  
I need to do certain actions based on the query parameters on the request So I am trying to access the query parameters when the stream starts but I am getting the empty with the getQueryStr​() method.

public void onStreamCreate(IMediaStream stream) {  
getLogger().error("onstreamcreate "+stream.getQueryStr());  
}

WSE version; 4.8.10

Please help me with how to get the query parameters?

---

<div class="post-metadata">

### Author: ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)
#### Post date: [October 8, 2021, 7:36pm UTC](https://community.wowza.com/t/onstreamcreate-getquerystr/93928/2 "2021-10-08T19:36:13Z")

</div>

You should be able to call `client.getQueryStr().toString()` to obtain the parameters from the incoming source.

Is that what you are looking for?

If you are looking for parameters for playback, we may need to check if the player is sending a query stream at all. If not, it’ll be null. Send us a support ticket and we’d be happy to walk you through this.

---

<div class="post-metadata">

### Author: ![Kousthub\_Gangarapu](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@Kousthub\_Gangarapu](https://community.wowza.com/u/Kousthub_Gangarapu)
#### Post date: [October 10, 2021, 9:01am UTC](https://community.wowza.com/t/onstreamcreate-getquerystr/93928/3 "2021-10-10T09:01:14Z")

</div>

Hi,

I tried by calling **stream.getClient().getQueryStr().toString()** which is throughing NullPointer exception.

Sample code block

```
public void onStreamCreate(IMediaStream stream) {
     getLogger().error("onstreamcreate "+stream.getClient().getQueryStr().toString()); //excepting e=123
}

```

Sample URL:  
[http://121.0.0.1/cdn-live/](http://121.0.0.1/cdn-live/)_definst_/testfeed/playlist.m3u8?e=123

Is that what you are suggesting?

---

<div class="post-metadata">

### Author: ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)
#### Post date: [October 11, 2021, 3:49pm UTC](https://community.wowza.com/t/onstreamcreate-getquerystr/93928/4 "2021-10-11T15:49:04Z")

</div>

That’s what I was told yes, but we will need a support ticket to further investigate. It’s impossible to diagnose in the forums without full access to your configuration and files you see. In order to help you accurately resolve this, can you submit a ticket to us today? Thanks @Kousthub_Gangarapu
