Showing Agent Names side by side in tableau - tableau-api

I have 2 columns first one Id and another is Agent. Each Id has different Agents.
Now I need to show names besides each ID.
But I am getting data like below.
I kept ID and name in rows shelf
Expected out put :
ID Name Name
12345 Ram Rajesh
4444 Ravi Raghu
3333 Reena Teena James
Out put I am getting :
ID Name
12345 Ram
12345 Rajesh
4444 Ravi
4444 Raghu
3333 Reena
3333 Teena
3333 James

Related

How many sockets are currently been used on windows 10

I'm trying to find out how many sockets are currently being used on my machine.
If it's possible, I need an API that returns the exact number of sockets being used at any time.
I have tried TCPView, and the command netstat for many version, but all I get is a list of connections.
Just the amount?
netstat -a -n | find /i "127.0.0.1" | find /I "ESTABLISHED" > t.txt && powershell -command "& Get-Content "t.txt" | Measure-Object -Line"
Replace 127.0.0.1 if needed. On my box it resulted in
Lines Words Characters Property
----- ----- ---------- --------
24
Looking at t.txt, it will will show something like:
TCP 127.0.0.1:49672 127.0.0.1:49673 ESTABLISHED
TCP 127.0.0.1:49673 127.0.0.1:49672 ESTABLISHED
TCP 127.0.0.1:49674 127.0.0.1:49675 ESTABLISHED
TCP 127.0.0.1:49675 127.0.0.1:49674 ESTABLISHED
TCP 127.0.0.1:57354 127.0.0.1:57355 ESTABLISHED
TCP 127.0.0.1:57355 127.0.0.1:57354 ESTABLISHED
TCP 127.0.0.1:57356 127.0.0.1:57357 ESTABLISHED
TCP 127.0.0.1:57357 127.0.0.1:57356 ESTABLISHED
If you are just interested in the number of TCP/UDP sockets in use, have a look at the following APIs:
GetTcpStatistics(), GetTcpStatisticsEx(), GetTcpStatisticsEx2()
GetUdpStatistics(), GetUdpStatisticsEx(), GetUdpStatisticsEx2()
But those don't really tell you anything useful, and the stats are global, not per-interface. There are other APIs that can enumerate the available sockets and retrieve actual details about them (statuses, port numbers, etc), which you can use to fine-tune your searching as needed (eg, ESTABLISHED on IP x Port y):
GetTcpTable(), GetTcpTable2(), GetExtendedTcpTable()
GetUdpTable(), GetUdp6Table(), GetExtendedUdpTable()

Tcp ports from proc/net/tcp are completely different from the tcp source ports after parsing .pcap files(android)

I am working on a way to find a mapping between the application and the url it accesses at a given timestamp. For this I first got the mapping of tcp port number to url by parsing the packet dump file from time t1 to t2. I wrote this python code for parsing:
import dpkt
f = open('/home/nachiket/Desktop/Research work/my project/s1-pcapFilesParsed/pcap files/2017_04_01_023856.pcap')#2017_03_30_013908.pcap #2017_03_02_010455.pcap
pcap = dpkt.pcap.Reader(f)
g=open('s1final.txt','w')
g.write("\n")
list=set()
for ts, buf in pcap:
eth = dpkt.ethernet.Ethernet(buf)
ip = l2.data
tcp = ip.data
if type(tcp)!=str:
if (tcp.dport == 80 or tcp.dport == 443) and len(tcp.data) > 0:
try:
http1 = dpkt.http.Request(tcp.data)
if http1.uri!='/_ping':
g.write("p "+str((hex(tcp.sport).split('x')[-1])).upper()) #converted to hex
except (dpkt.dpkt.NeedData, dpkt.dpkt.UnpackError):
continue
Now I mapped the tcp port to uid from /proc/net/tcp and from uid I got application name. Thus I merged the two files and got the tcp port to application name mapping at a given timestamp.
The python code:
#! /bin/bash
for i in {1..80}
do
adb shell "date +%s" > dump/netdump$i
adb shell "cat /proc/net/tcp" >> dump/netdump$i
echo finished: $i
sleep 1
done
The problem I faced is the tcp ports from running the first code doesnt match at all with the tcp ports running from second code. If was supposed to merge them on basis on common tcp ports used by application at a given timestamp and hence to find the application to url mapping at a given time. But the ports doesnt match.
I know that the /proc/net/tcp is used for getting details of each socket but it shouldn't affect the tcp ports I guess.
PS: I am a beginner and have done research before submitting question
Thank you

Bonjour: Can not ping through serviceName on Windows

I develop our application and can succeed to get hotsname through func: ServiceFound(DNSSDService sref, DNSSDFlags flags, uint ifIndex, String serviceName, String regType, String domain)
I checked the wireshark and Log, the serviceName is right.
My question:
Why I can not ping it through "serviceName.domain", e.g: ping serviceName.local. (I want to use ping to test the network available beofre run my application. now it is blocked the failed ping)
But I can ping it through the real IP, e.g: ping 1.2.3.4 (This means that the network is ok)
ServiceFound and ServiceResolved only provide serviceName.
So how to solve this problem:
1) one simple way to get IP
or 2) how to solve the problem of "ping serviceName.local"
Thanks a lot for your support in advance!
************************Update*******
I retest it on other PC:
I use dns-sd.exe to debug the network
Using following command can get servicename
$ dns-sd.exe -B _http._tcp
Browsing for _http._tcp
Timestamp A/R Flags if Domain Service Type Instance Name
4:33:52.663 Add 3 3 local. _http._tcp. test
Using following command can get zone file
$ dns-sd.exe -Z _http._tcp
Browsing for _http._tcp
_http._tcp PTR Officejet\032Pro\032L7500\032[FEDCE8]._http._tcp
Officejet\032Pro\032L7500\032[FEDCE8]._http._tcp SRV 0 0 80 HPFEDCE8.local. ; Replace with unicast FQDN of target host
Officejet\032Pro\032L7500\032[FEDCE8]._http._tcp TXT ""
using following command can get IP (based on HPFEDCE8.local. in above feedback)
$ dns-sd.exe -G v4 HPFEDCE8.local.
Timestamp A/R Flags if Hostname Address TTL
4:43:38.965 Add 2 3 bej1301Dell2360.local. 10.61.20.99 240
So I can ping it through HPFEDCE8.local.
But in my Test PC: "$ dns-sd.exe -B _http._tcp" is ok, but others commands are failed.
So I think this is the root cause.
So my question is:
as I know, we can use "instance Name" to generate the hostname: test.local.
why they are different from "HPFEDCE8.local." in the zone file
why "ping HPFEDCE8.local." ok and "ping test.local." failed
Do you have any others ideas for my Test PC?
Thanks a lot!!

How can I implement a simple WHOIS proxy in Perl?

I have several WHOIS servers for which I want to have a single proxy. The proxy should forward requests to appropriate servers based on the data in the query. How to approach this problem?
Step 1 read the RFC for WHOIS
Step 2 implement a mock server with Net::Server
Step 3 implement the proxy using your mock server and Net::Whois::Proxy or some other WHOIS module
A quick scan of the RFC seems to say that it is just a simple text based protocol that expects one CRLF terminated line and then sends a blob of CRLF terminate lines and closes the socket.
Yep, it really looks that simple, given this code
#!/usr/bin/perl
{
package Whois;
use strict;
use warnings;
use parent 'Net::Server';
sub process_request {
my $request = <>;
print "you sent me $request";
}
}
Whois->run;
you can say
whois -h localhost -p 20203 foo.com
and get back
you sent me foo.com
Given the "high-load" tag, you will probably want to switch over to Net::Server::PreForkSimple personality when you are done with testing.
And just because I was bored:
#!/usr/bin/perl
package Whois {
use strict;
use warnings;
use parent 'Net::Server::PreFork';
use Net::Whois::Raw;
my %handler = (
org => "whois.publicinterestregistry.net",
);
sub process_request {
(my $request = <>) =~ s/[.]([^.]+)\x{0d}\x{0a}/.$1/;
print exists $handler{$1} ?
whois $request, $handler{$1} :
"I don't know where to look for $request\r\n";
}
}
Whois->run(
user => "nobody",
group => "nobody",
port => 43,
min_servers => 1, #min number of children
max_servers => 10, #max number of children
min_spare_servers => 1, #fork if we don't have this many waiting
max_spare_servers => 5, #kill if we have this many waiting
max_requests => 10_000, #num of requests before killing a child
);
which when I run
sudo perl whois.pl
and then
whois -h localhost foo.org
gives us
NOTICE: Access to .ORG WHOIS information is provided to assist persons in
determining the contents of a domain name registration record in the Public Interest Registry
registry database. The data in this record is provided by Public Interest Registry
for informational purposes only, and Public Interest Registry does not guarantee its
accuracy. This service is intended only for query-based access. You agree
that you will use this data only for lawful purposes and that, under no
circumstances will you use this data to: (a) allow, enable, or otherwise
support the transmission by e-mail, telephone, or facsimile of mass
unsolicited, commercial advertising or solicitations to entities other than
the data recipient's own existing customers; or (b) enable high volume,
automated, electronic processes that send queries or data to the systems of
Registry Operator or any ICANN-Accredited Registrar, except as reasonably
necessary to register domain names or modify existing registrations. All
rights reserved. Public Interest Registry reserves the right to modify these terms at any
time. By submitting this query, you agree to abide by this policy.
Domain ID:D1608104-LROR
Domain Name:FOO.ORG
Created On:10-Jan-1995 05:00:00 UTC
Last Updated On:07-Mar-2011 00:26:43 UTC
Expiration Date:09-Jan-2012 05:00:00 UTC
Sponsoring Registrar:Fabulous.com Pty Ltd. (R133-LROR)
Status:CLIENT DELETE PROHIBITED
Status:CLIENT TRANSFER PROHIBITED
Registrant ID:fabwpp-000700385
Registrant Name:Domain Hostmaster, CustomerID : 85519846801225
Registrant Organization:Whois Privacy Services Pty Ltd
Registrant Street1:PO Box 923
Registrant Street2:
Registrant Street3:
Registrant City:Fortitude Valley
Registrant State/Province:QLD
Registrant Postal Code:4006
Registrant Country:AU
Registrant Phone:+61.730070090
Registrant Phone Ext.:
Registrant FAX:+61.730070091
Registrant FAX Ext.:
Registrant Email:85519846801225-959797#whoisprivacyservices.com.au
Admin ID:fabwpp-000700385
Admin Name:Domain Hostmaster, CustomerID : 85519846801225
Admin Organization:Whois Privacy Services Pty Ltd
Admin Street1:PO Box 923
Admin Street2:
Admin Street3:
Admin City:Fortitude Valley
Admin State/Province:QLD
Admin Postal Code:4006
Admin Country:AU
Admin Phone:+61.730070090
Admin Phone Ext.:
Admin FAX:+61.730070091
Admin FAX Ext.:
Admin Email:85519846801225-959797#whoisprivacyservices.com.au
Tech ID:fabwpp-000700385
Tech Name:Domain Hostmaster, CustomerID : 85519846801225
Tech Organization:Whois Privacy Services Pty Ltd
Tech Street1:PO Box 923
Tech Street2:
Tech Street3:
Tech City:Fortitude Valley
Tech State/Province:QLD
Tech Postal Code:4006
Tech Country:AU
Tech Phone:+61.730070090
Tech Phone Ext.:
Tech FAX:+61.730070091
Tech FAX Ext.:
Tech Email:85519846801225-959797#whoisprivacyservices.com.au
Name Server:NS1.HITFARM.COM
Name Server:NS2.HITFARM.COM
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
Name Server:
DNSSEC:Unsigned
whois.publicinterestregistry.net
I'm no expert on whois, but Net::Whois::Proxy would seem to be what you want.

WHOIS for given TLD?

How do I programatically determine the WHOIS server for a given TLD?
For name servers, I just query a.root-servers.net
Is there an equivalent procedure for WHOIS?
I know "host -t ns xxx." yields the DNS for a TLD: can the WHOIS
server be derived from that result?
It's in the SRV-record _nicname._tcp.tld -
For example;
# dig +short SRV _nicname._tcp.no
0 0 43 whois.norid.no.
More information can be found in the Wikipedia-article of whois.
That works for some tld's at least - but not .com.
tld.whois-servers.net is a commonly used alias that should point to a valid whois-server. For example com.whois-servers.net