Reporting

How to subtract Total Amount to  WithdrawRequest to total Amount of  DepositRequest?

Kisame27
Explorer

How to subtract Total Amount to  WithdrawRequest to total Amount of  DepositRequest 

Result=WithdrawRequest-DepositRequest 

Kisame27_0-1649683321953.png

 

Labels (2)
0 Karma

gcusello
Legend

Hi @Kisame27,

sorry but I don't understand, could you share your result and indicate which field you want to add to which other field?

Ciao.

Giuseppe

0 Karma

Kisame27
Explorer

For Example : i have  three Column 

transactiontype      Amount       CostumerName

DP                                        20               Tom

WD                                      30               Tom

DP                                       10                Elen

WD                                      15               Elen

DP                                        50              Tom

....                                           ...                 ....

....                                           ....                ....

i want to get:    Result  as Table For Tom= Sum(Dep) -Sum(WD)   Tom= 70-30=40

                                                     Elen=  Sum(Dep) -Sum(WD)   Elen= 10-15=-5

 

Result as Table  With 4 columns

    DP    WD         CostumerName  Result

   70         30           Tom                        40

   10          15          Elen                        -5

   ...                          ....                             .....

    ....                         ....                            .....

 

thanks for Helping 

0 Karma

gcusello
Legend

Hi @Kisame27,

if the transactiontype are always the same (DP or WD), you could run something like this:

| your_search
| stats sum(eval(if(transactiontype="WD",Amount,0))) AS WD sum(eval(if(transactiontype="DP",Amount,0))) AS DP BY CostumerName
| eval Result=DP-WD

Ciao.

Giuseppe

 

Kisame27
Explorer

You are Very Good Person, Thanks For Helping  😍

0 Karma

gcusello
Legend

Hi @Kisame27,

you're welcome, it's a pleasure.

Please accept the answer for the other people of Community.

Ciao and happy splunking.

Giuseppe

Kisame27
Explorer

cs_uri_query="*DepositRequest*" OR cs_uri_query="*WithdrawRequest*"

| rex "Amount\':(?<amount>[^+]+)"
| rex "CustomerId\':(?<GUID>[^+]+)"
|rex "ProviderName\':(?<provider>[^+]+)"
| search GUID = '3f55310a-2f17-476c-a28b-0d50c444b03f'

================================================================

 

DepositRequest="{'ProviderName':'Vazisubani'+'BrandName':'Betsmarket'+'CustomerId':'3f55310a-2f17-476c-a28b-'+'Amount':0.00+'TransactionId'

 

WithdrawRequest="{'ProviderName':'Vazisubani'+'BrandName':'BestMarket'+'CustomerId':'3f55310a-2f17-476c-a28b'+'Amount':175.0+'TransactionId':'625314d6a230ee62325ed373'

 

 i want to get  Table with new column which was created by me 

 CustomerId                                                DepositRequest    WithdrawRequest             Result

 3f55310a-2f17-476c-a28b                     0.00                             175                                   -175

 

 

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...