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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...